home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Celestin Apprentice 5
/
Apprentice-Release5.iso
/
Information
/
THINK C Digest
/
1994
/
94-03
< prev
next >
Wrap
Text File
|
1995-12-31
|
139KB
|
4,376 lines
Path: ucivax!gateway
From: Lance.Helsten@m.cc.utah.edu (Lance Helsten)
Subject: Re: CDLOGDialog behavior
Message-ID: <9402281817.aa18638@q2.ics.uci.edu>
In-Reply-To: <9402162203.aa22070@q2.ics.uci.edu>
Content-Type: TEXT/PLAIN; charset=US-ASCII
MIME-Version: 1.0
Newsgroups: fa.think-c
X-Message-ID: <Pine.3.07.9402281900.C27992-b100000@u.cc.utah.edu>
Approved: usenet@q2.ics.uci.edu
Lines: 30
Date: 1 Mar 94 02:17:23 GMT
> Hmmm... I would say that it is definitely worth the effort to learn to
> program object-oriented code well. This will make you a better C or
> pascal programmer. I also think that one can write good object oriented
> I feel that the jury is still out on object-oriented programming. I also
> have a low regard for C++ in particular. I believe that it was an error
> to require that the same linker be used for C++ as for C. The language
> would have been a lot cleaner if one could compile into object code
> that would carry semantic information into library files (no need for
> name mangling, etc.) There are other gripes I have with it, but I do
> not recall them now.
>
Actually, OOP can come or go OOD is where the real magic is. The whole
point of OOD is to keep the end-user in the design and engineering part of
the project for as long as possible.
Your argument about the name mangler is unfounded. First the linke needs
to link Assembly, Pascal, C, C++, and any other language that you have
available in you Dev Enviroment; so there needs to be a consistent naming
convention. Plus in all the time that I have been programming I have never
had to debug a linker, so I have never seen the name mangling going on
(though I do know about it). Also, if the compiler is doing its job
correctly then the problem of MacsBug's names being mangled should not even
exists. I believe Symantec C++ does not mangle those names.
Lance
Path: ucivax!gateway
From: Lance.Helsten@m.cc.utah.edu (Lance Helsten)
Subject: Re: Modeless Dialog Source
Message-ID: <9402281838.aa19798@q2.ics.uci.edu>
In-Reply-To: <9402191059.aa10251@q2.ics.uci.edu>
Content-Type: TEXT/PLAIN; charset=US-ASCII
MIME-Version: 1.0
Newsgroups: fa.think-c
X-Message-ID: <Pine.3.07.9402281911.F27992-b100000@u.cc.utah.edu>
Approved: usenet@q2.ics.uci.edu
Lines: 28
Date: 1 Mar 94 02:38:28 GMT
> I'm looking for solid, commented Modeless Dialog source code. My code *does*
> work, but I want to check it against an established skeleton. I also have
> a number of questions.
The way to handle a Modeless dialog is identical to a document window. But
you may need to put in your own event loop to handle the box.
>
> One question I would like answered is how people handle text boxes that are
> supposed to contain only integers. Do you preprocess key presses? Do you
> do a check before the dialog closes? Do you allow keys into DialogSelect,
> and then validate the text box immediately afterward?
I always validate the keys that I will allow into a TEBox before I put it
there and if the user does press a non-allowed key then I beep at him.
Also, if the user keeps pressing keys then he may get confused so after a
couple of tries you could bring up an Alert informing him of the problem
(Check IM Dialog manager on alert stages).
If you do a check before the dialog closes then the user is not
getting immediate feedback when keys are pressed (which is a no-no on UI
guidlines). If you validate the TEBox that is giving immediate feedback
but it does not look clean; the update on the box could confuse the user
if he didn't see the change.
Lance
Path: ucivax!gateway
From: Lance.Helsten@m.cc.utah.edu (Lance Helsten)
Subject: Re: GetDateTime()
Message-ID: <9402281843.aa20117@q2.ics.uci.edu>
In-Reply-To: <9402241141.aa12199@q2.ics.uci.edu>
Content-Type: TEXT/PLAIN; charset=US-ASCII
MIME-Version: 1.0
Newsgroups: fa.think-c
X-Message-ID: <Pine.3.07.9402281940.I27992-9100000@u.cc.utah.edu>
Approved: usenet@q2.ics.uci.edu
Lines: 16
Date: 1 Mar 94 02:43:03 GMT
Shawn,
> Have you guys thought of using the tick counter as the source
> of your random seed number? That is what I use, and it works
> quit well.
>
Apple does not recommend using tick counter any more. The better approach
is to get the date time. This also applies to timing events as well, since
Apple does not garentee (Misspelling I know :( ) that there are 60
ticks/second on new machines.
Lance
Path: ucivax!gateway
From: G.POLDER@cpro.agro.nl
Subject: default folder for SFGetFile
Message-ID: <9403010323.aa17547@q2.ics.uci.edu>
Content-transfer-encoding: 7BIT
Newsgroups: fa.think-c
X-Message-ID: <9403011123.AA13768@ganges.cpro.agro.nl.agro.nl>
Approved: usenet@q2.ics.uci.edu
Lines: 4
Date: 1 Mar 94 11:23:23 GMT
X-Envelope-to: think-c@ics.uci.EDU
How can I start SFGetFile in a certain (default) folder?
thanks, Gerrit.
g.polder@cpro.agro.nl
Path: ucivax!gateway
From: walrathw@rferl.org (WalrathW)
Subject: ToneDial Src Upload
Message-ID: <9403010601.aa07463@q2.ics.uci.edu>
Content-transfer-encoding: 7BIT
Content-type: TEXT/PLAIN; CHARSET=US-ASCII
Newsgroups: fa.think-c
X-Message-ID: <01H9GN1JWELE8WXFN1@MUVAXA.RFERL.ORG>
Approved: usenet@q2.ics.uci.edu
Lines: 5
Date: 1 Mar 94 14:01:12 GMT
I just uploaded C and Pascal source for generating touch tones to
ftpbio.bgsu.edu (Tone_Dialer.sit.hqx). It's in the incoming directory waiting
to be processed (so snag it from there if you can't wait ;) ).
-wayne
Path: ucivax!gateway
From: andy.law@afrc.ac.uk (Big Nose)
Subject: User Procs and event filters in Control Panels
X400-Originator: andy.law@afrc.ac.uk
Content-Identifier: 11830C533100
Message-ID: <9403010929.aa18730@q2.ics.uci.edu>
X400-Recipients: think-c@ics.uci.edu
Sensitivity: Company-Confidential
Newsgroups: fa.think-c
X-Message-ID: <2041261701031994/A08651/IAPE/11830C533100*@MHS>
X400-Received: by mta sun2.mhs-relay.ac.uk in /PRMD=uk.ac/ADMD= /C=gb/; Relayed; Tue, 1 Mar 1994 17:28:32 +0000
X400-Received: by mta arcs.afrc.ac.uk in /PRMD=UK.AC/ADMD= /C=GB/; Relayed; Tue, 1 Mar 1994 17:28:58 +0000
X400-Received: by /PRMD=UK.AC/ADMD= /C=GB/; converted (ia5 text (2)); Relayed; Tue, 1 Mar 1994 17:28:38 +0000
Approved: usenet@q2.ics.uci.edu
X400-Content-Type: P2-1988 (22)
Lines: 24
Date: 1 Mar 94 17:29:38 GMT
X400-MTS-Identifier: [/PRMD=UK.AC/ADMD= /C=GB/;2041261701031994/A08651/IAPE]
Dear All,
I have a control panel that needs to put up a modal dialog box under
certain circumstances. Obviously, I would like to be able to frame
the default button and do some other fancy stuff with event filters.
However, as I understand it, control panels wander around memory
quite a bit, so such routines are likely to cause some amount of
chaos. What is the best way to get around this. The two ideas I've
come up with are (a) Lock the control panel down before doing the
dialog and then unlock it afterwards. or (b) Write the userProcs and
event filters as separate code resources, load them in and lock them
down before doing the dialog and then unlock them again afterwards.
It strikes me that (a) is easiest but (b) is cleaner in that only the
necessary bits are locked down.
Which is the best (correct) approach, or there a better alternative?
Thanks in advance
Andy Law
( LAWA @ afrc.ac.uk Big Nose in Edinburgh )
Path: ucivax!gateway
From: wintermyrej@lonexa.admin.rl.af.mil (Jim Wintermyre)
Subject: Re: A question about colors
Message-ID: <9403011134.aa27667@q2.ics.uci.edu>
Newsgroups: fa.think-c
X-Message-ID: <9403011933.AA07855@lonexc.admin.rl.af.mil>
Approved: usenet@q2.ics.uci.edu
Lines: 34
Date: 1 Mar 94 19:34:14 GMT
Hi. I posted a message yesterday about how you sometimes might not be able
to see all the colors in a displayed image even if all the colors are in the
palette. I need to clarify that.
I did not mention that this problem only shows up if you are using CopyBits
to copy from a direct pixel map to an indexed pixel map. In my case, I had a
32-bit direct offscreen GWorld, and I was using CopyBits to copy it to an
8-bit window. So in the example I gave, the red ramp would show up with only
16 shades of red, as I described.
If instead you have an 8-bit offscreen GWorld, and you fill it with a red
ramp (by simply writing the values of the indices of the red shades in the
palette into the the GWorld buffer), and then display it in an 8-bit window
by using CopyBits, you *don't* see the problem I described. You see all 256
shades of red (actually 254 + black and white).
The reason for this is that in the second case, CopyBits does not have to
convert between bit depths, which is when the inverse table matching method
would normally be invoked. The inverse table is used whenever QD has to
convert an RGB value into a color table index. In the first case above, the
pixel values in the 32-bit GWorld pixel map are acutally RGB values, so they
must be converted to the indices of the closest available color in the 8-bit
color table of the display device (where the window is) - thus the inverse
tables are used. In the second case above, the values in the 8-bit GWorld
pixel map are already color table indices, so no conversion is necessary
(assuming that the color table in the offscreen GWorld is the same as that of
the destination device).
I hope this clears up what I said earlier.
Jim
winter@ai.rl.af.mil
wintermyrej@lonex.rl.af.mil
Path: ucivax!gateway
From: boudinot@bobby.iaf.cnrs-gif.fr
Subject: Subscription to think-c mailing list
Message-ID: <9403020237.aa20437@q2.ics.uci.edu>
Newsgroups: fa.think-c
X400-Received: by /PRMD=cicb/ADMD=atlas/C=FR/;
Relayed; 02 Mar 94 11:37:46+0100
X400-Received: by /PRMD=cnrs-gif/ADMD=0/C=fr/;
Relayed; 02 Mar 94 11:37:25+0100
X-Message-ID: <94030211352589@bobby.iaf.cnrs-gif.fr>
Approved: usenet@q2.ics.uci.edu
X-Vms-To: SMTP%"think-c@ics.uci.edu"
Lines: 3
Date: 2 Mar 94 10:37:47 GMT
SUB think-c
Path: ucivax!gateway
From: joe@martin.cm.utexas.edu
Subject: Data and Resource Forks
Message-ID: <9403020623.aa12351@q2.ics.uci.edu>
Newsgroups: fa.think-c
X-Message-ID: <9403021420.AA05677@martin.cm.utexas.edu>
Approved: usenet@q2.ics.uci.edu
Lines: 24
Date: 2 Mar 94 14:23:52 GMT
We all know that the Mac OS create files with both
data and resource forks. And when one copies files using
Mac applications or the Finder that both forks get copied.
However, when MacMint or other unix-like OS designed to work
on the Mac copies files, only the data fork get copied.
Questions: Are the data fork and resource forks actually separate
and different in a low level way at looking at things? That is,
don't both contain binary info so that a command to copy a file
bit by bit would copy the entire file including data, resource, or
any other kind of forks? Is the distinction between resource
and data forks just an OS distinction based on how the OS handle
the info from that file and how it organized the addresses and
pointers to the different forks? Or is this distinction something
more, so that a file named "FOO" actually consist of two files:
"FOO:data" and "FOO:resource" such that MacMint or other unix-like
OS when asked to copy "FOO" would only copy "FOO:data" not
"FOO:data" and "FOO:resource".
Is this clear? My apology if this is not.
Joe
Path: ucivax!gateway
From: FEATS@vtvm1.cc.vt.edu (Steve Greenfield)
Subject: Finder Icon Editor
Message-ID: <9403020624.aa12365@q2.ics.uci.edu>
Newsgroups: fa.think-c
X-Message-ID: <9403020623.aa12365@q2.ics.uci.edu>
Approved: usenet@q2.ics.uci.edu
Lines: 30
Date: 2 Mar 94 14:24:02 GMT
I created a Family of Icons for my application which used a custom RGB
color (R -> 65535, G -> 65270, B -> 35862). Everything appears fine
except one thing. According to my ResEdit Reference:
"The display bar area on the far right shows the icon in the
form of 3 groups of images against the background that was
selected from the Icons menu (normal, open, offline). Within
the display bar area the icons are shown unselected on the
left and selected on the right."
Well, my selected normal icon (right side of display bar area) and my
unselected normal icon (left side of display bar area) were the same.
Other applications that I look at using ResEdit have a Selected normal
icon that is shaded darker than the Unselected normal icon. When you
single click on other application icons they get darker but when you
single click on mine it stays the same.
I finally changed the color in my Icon to an 'Apple Icon Color' (first
selection under the Color menu within the Finder Icon Editor) and then
my Selected normal icon became shaded darker. Now when I single click
on my Application Icon it gets darker as per other applications.
Why, when I use a custom color in my Icon, does the shading not appear
for my selected normal variation? Is there a way around this apparent
limitation of the Finder Icon Editor under ResEdit 2.1.1? I want to use
my custom color but I definitely want the darker shading for my selected
normal icon! Thanks in advance for any advice or explanations!
/steve greenfield <feats@vtvm1.cc.vt.edu>
Path: ucivax!gateway
From: tbrown@dorsai.dorsai.org (Tommy Brown)
Subject: Re: Data and Resource Forks
Message-ID: <9403021125.aa01094@q2.ics.uci.edu>
In-Reply-To: <9403020623.aa12351@q2.ics.uci.edu>
Content-Type: TEXT/PLAIN; charset=US-ASCII
Mime-Version: 1.0
Newsgroups: fa.think-c
X-Message-ID: <Pine.3.89.9403021441.A18096-0100000@dorsai.dorsai.org>
Approved: usenet@q2.ics.uci.edu
Lines: 16
Date: 2 Mar 94 19:25:59 GMT
As far as I understand it, the Mac data and resource forks of a file are
essentially two separate files. In the OS, when you open the file, you
can either open the resource fork or the data fork (or both at once, but
then you have to have two separate paths, one for each fork). The reason
most utilities copy only the data fork is because that's the most likely
to be useful on the Unix end; the resource fork wouldn't make any sense,
being in a Mac-specific format. I don't know how it's stored physically
on a disk, whether the resource fork is stored contiguously with the data
fork. Note that there is a third place where file data is stored, the
finder flags and other info about the file - this information is stored
in the catalog.
Tommy Brown
tbrown@dorsai.dorsai.org tommy6@aol.com
"Please continue this petty bickering; I find it most intriguing." - Data
Path: ucivax!gateway
From: omalleyj@umich.edu ("Janelle L. O'Malley")
Subject: list manager
Message-ID: <9403021709.aa26345@q2.ics.uci.edu>
Content-Type: TEXT/plain; charset=US-ASCII
Newsgroups: fa.think-c
X-Message-ID: <Mailstrom.1.04.41954.15089.omalley@d.imap.itd.umich.edu>
Approved: usenet@q2.ics.uci.edu
Lines: 17
Date: 3 Mar 94 01:09:56 GMT
I have a question concerning the list manager. I created a list by calling
LNew(...) into which I insert 800 cells using LAddRow(...). I store data into
the cells with LSetCell() with the dataPtr pointing to a string of size 100
characters. The problem is when I scroll the list and the cells outside of the
list display area become visible, they are displayed as junk, in spite of the
string pointed to by dataPtr being valid. I seem to remember the list manager
imposes some kind of limit on the data size, I think 32K (sorry, my IM's are at
work). Am I hitting the limit? If so what is the accepted technique to handle
this?
A list of size 800 is a medium size list for this application. When the list is
of size 80 everything is fine. Any ideas?
Thanks
Kevin
Path: ucivax!gateway
From: chrism@corp.cirrus.com (Chris Metcalfe)
Subject: Re: Data and Resource Forks
Message-ID: <9403021720.aa27143@q2.ics.uci.edu>
Newsgroups: fa.think-c
X-Message-ID: <9403030120.AA24468@tango.corp.cirrus.com>
Approved: usenet@q2.ics.uci.edu
Lines: 18
Date: 3 Mar 94 01:20:38 GMT
There is a parameter block at the beginning of HFS files
that has all sorts of information, including the displacements
into the physical disk file for the resource fork and the
data fork. This is a very rich area, Mac programmers
are shielded from knowing about it all by the File Manager
routines. Contained in the parameter block is a File
Attributes 16-bit flag array, in addition to the copious
HFS info.
I like MacMiNT. I recently compared it to Tenon Intersystems'
MachTen. Their EMACS *requires* virtual memory hardware, and
by asking questions I found out that you have to reboot after
launching MachTen to return to a system without MachTen in
RAM! All those benefits for $700 (the $500 "Personal" system
doesn't run virtual memory, thus no EMACS)! What are you using
MacMiNT for (besides free)?
-- Chris Metcalfe
Path: ucivax!gateway
From: walrathw@rferl.org (WalrathW)
Subject: RE: list manager
Message-ID: <9403030122.aa18989@q2.ics.uci.edu>
Content-transfer-encoding: 7BIT
Content-type: TEXT/PLAIN; CHARSET=US-ASCII
Newsgroups: fa.think-c
X-Message-ID: <01H9J5W9TDPU8WXC19@MUVAXA.RFERL.ORG>
Approved: usenet@q2.ics.uci.edu
Lines: 33
Date: 3 Mar 94 09:22:54 GMT
>
>
_______________________________________________________________________________
> From: Janelle L. O'Malley on Thu, Mar 3, 1994 5:19
> Subject: list manager
> To: think-c@ics.uci.edu
>
> I have a question concerning the list manager. I created a list by calling
> LNew(...) into which I insert 800 cells using LAddRow(...). I store data into
> the cells with LSetCell() with the dataPtr pointing to a string of size 100
> characters. The problem is when I scroll the list and the cells outside of
> the
> list display area become visible, they are displayed as junk, in spite of the
> string pointed to by dataPtr being valid. I seem to remember the list manager
> imposes some kind of limit on the data size, I think 32K (sorry, my IM's are
> at
> work). Am I hitting the limit? If so what is the accepted technique to handle
> this?
>
> A list of size 800 is a medium size list for this application. When the list
> is
> of size 80 everything is fine. Any ideas?
>
> Thanks
>
> Kevin
32k is correct. If each entry is 100 bytes long (did I understand you
correctly?) then after 300 or so entries you are probably over your limit. You
can write your own LDEF to get around this, samples abound. There are also some
commercial packages available which don't suffer from these limits. What you
are doing is called "Manger Abuse!" ;-)
-wayne
Path: ucivax!gateway
From: skorol@uiuc.edu (Savva Korolev)
Subject: unsubscribe
X-Sender: skorol@ncsa.uiuc.edu (Unverified)
Message-ID: <9403030902.aa22471@q2.ics.uci.edu>
Content-Type: text/plain; charset="us-ascii"
Mime-Version: 1.0
Newsgroups: fa.think-c
X-Message-ID: <9403031702.AA18954@newton.ncsa.uiuc.edu>
Approved: usenet@q2.ics.uci.edu
Lines: 11
Date: 3 Mar 94 17:02:49 GMT
unsubscribe
Savva
___________
->from office e-mail: skorol@uiuc.edu
THE CHEMVIZ GROUP
Path: ucivax!gateway
From: kirk_crawford@qmail2.aero.org (Kirk Crawford)
Subject: How do I get Time Zone and
Message-ID: <9403031010.aa26851@q2.ics.uci.edu>
Posted-Date: 3 Mar 94 10:13:14 U
Newsgroups: fa.think-c
X-Message-ID: <199403031810.AA05834@aerospace.aero.org>
Approved: usenet@q2.ics.uci.edu
Lines: 12
Date: 3 Mar 94 18:10:57 GMT
Subject: How do I get Time Zone and Location from Map?
Does anyone know how to get the time zone and location information from the Map
control panel from within my program?
Please reply directly to me and I will summarize to the group if anyone
requests it.
-Kirk
crawford@aero.org
Path: ucivax!gateway
From: resnick@cogsci.uiuc.edu (Pete Resnick)
Subject: Re: How do I get Time Zone and Location from Map?
X-Sender: resnick@tarski.cogsci.uiuc.edu
Message-ID: <9403031247.aa06987@q2.ics.uci.edu>
Content-Type: text/plain; charset="us-ascii"
Mime-Version: 1.0
Newsgroups: fa.think-c
X-Message-ID: <199403032047.AA18323@tarski.cogsci.uiuc.edu>
Approved: usenet@q2.ics.uci.edu
Lines: 89
Date: 3 Mar 94 20:47:58 GMT
>Does anyone know how to get the time zone and location information from the Map
>control panel from within my program?
Use the ReadLocation() procedure. To set this information, you would use
WriteLocation(). The routines work on parameter RAM where the Map stores
this information. Each procedure takes one parameter, a pointer to a
MachineLocation struct that is as follows:
struct MachineLocation {
Fract latitude;
Fract longitude;
union{
char dlsDelta; /* High byte of the field */
long gmtDelta; /* Low three bytes of the field */
}gmtFlags;
};
typedef struct MachineLocation MachineLocation;
The latitude and longitude are fractions of a great circle.
The gmtDelta field represents the current offset (in seconds) from
Universal (Greenwich Mean) Time to the current time on the Macintosh. So,
if the current Macintosh time is 1:00 AM and current GMT is 2:00AM, then
gmtDelta should be -3600, since the current time is one hour (3600 seconds)
less than GMT. The gmtDelta field is a signed 3-byte value.
The high bit (bit 7) of the dlsDelta field represents the current state of
daylight savings time. If daylight savings time is in effect, then bit 7 of
dlsDelta is set; if daylight savings time is not in effect, then bit 7 is
clear. The other 7 bits (bits 0 through 6) of dlsDelta are reserved for
future use by Apple.
The value in gmtDelta always represents current offset from GMT, irrelavent
of the setting in dlsDelta; GMT can always be calculated by subtracting
gmtDelta from the current time. That means that during daylight savings
time, the value in gmtDelta will be different from the value during
standard time.
Note that gmtFlags is a union of dlsDelta and gmtDelta. That means that you
have to sign extend gmtDelta and preserve the dlsDelta when you set it.
long GetGmtDelta(MachineLocation *myLocation)
{
long returnVal;
returnVal = myLocation->gmtFlags.gmtDelta & 0x00ffffff;
if((returnVal >> 23) & 1)
returnVal |= 0xff000000;
return returnVal;
}
void SetGmtDelta(MachineLocation *myLocation, long myGmtDelta)
{
char tempDlsDelta;
tempDlsDelta = myLocation->gmtFlags.dlsDelta;
myLocation->gmtFlags.gmtDelta = myGmtDelta;
myLocation->gmtFlags.dlsDelta = tempDlsDelta;
}
Personally, I prefer to declare my own MachineLocation type so that I don't
have to worry about the sign extending; I let the compiler do it for me:
struct MyMachineLocation {
Fract latitude;
Fract longitude;
struct {
long dlsDelta : 8;
long gmtDelta : 24;
} gmtFlags;
};
typedef struct MyMachineLocation MyMachineLocation;
Since they are bitfields, the compiler deals with sign extending and
preserving fields.
Good luck.
pr
--
Pete Resnick (...so what is a mojo, and why would one be rising?)
Graduate assistant - Philosophy Department, Gregory Hall, UIUC
System manager - Cognitive Science Group, Beckman Institute, UIUC
Internet: resnick@cogsci.uiuc.edu
Path: ucivax!gateway
From: kirk_crawford@qmail2.aero.org (Kirk Crawford)
Subject: Re: Re- How do I get Time Zo
Message-ID: <9403031318.aa08993@q2.ics.uci.edu>
Posted-Date: 3 Mar 94 13:18:08 U
Newsgroups: fa.think-c
X-Message-ID: <199403032117.AA10376@aerospace.aero.org>
Approved: usenet@q2.ics.uci.edu
Lines: 18
Date: 3 Mar 94 21:18:07 GMT
Subject: RE>Re: How do I get Time Zone
PR> Use the ReadLocation() procedure. To set this
PR> information, you would use WriteLocation(). The
PR> routines work on parameter RAM where the Map stores
PR> this information. Each procedure takes one parameter,
PR> a pointer to a MachineLocation struct that is as
PR> follows:
Thanks Pete, I should have looked there.
Do you know how to get the actual city name that the Map control panel
displays?
For example, mine says "Los Angeles"?
-Kirk
crawford@aero.org
Path: ucivax!gateway
From: chrism@corp.cirrus.com (Chris Metcalfe)
Subject: Dean Yu's Windoid Code Crashes
Message-ID: <9403031359.aa11641@q2.ics.uci.edu>
Newsgroups: fa.think-c
X-Message-ID: <9403032159.AA01108@tango.corp.cirrus.com>
Approved: usenet@q2.ics.uci.edu
Lines: 40
Date: 3 Mar 94 21:59:24 GMT
Hi --
[I posted this in comp.sys.mac.programmers, and I
thought maybe someone in this group might have a
hint.]
I finally got a copy of Dean Yu's floating windoid code
as published by "develop" in the September 93 issue, and
the CD.
The sample app, "Floaters," is file stamped as follows:
Size: 33k on disk (33,062 bytes used)
Created: Fri, Aug 13, 1993, 12:02 PM
Modified: Tue, Sep 21, 1993, 9:43 AM
Version: 1.0d2, c 1993 Apple Computer,
Inc., all rights reserved
Suggested size: 256 K
Current size: 256 K
It crashes. Sigh.
It crashes whenever a dialog box is displayed. Its
own "About Floaters..." dialog from the Apple menu for
example. The crash occures as soon as the dialog
is dismissed, although the sample palettes have enough
time to redisplay themselves as active before the
sizzling bomb message displays.
The crash is: A System Error Occured
unimplemented trap
I'm running System 7.0.1 on a PowerBook 100 (16MHz
68000).
What gives?
-- Chris Metcalfe
Path: ucivax!gateway
From: idowell@bbn.com
Subject: Data and Resource to one file?
Message-ID: <9403031506.aa16097@q2.ics.uci.edu>
Newsgroups: fa.think-c
X-Message-ID: <9403031506.aa16097@q2.ics.uci.edu>
Approved: usenet@q2.ics.uci.edu
Lines: 8
Date: 3 Mar 94 23:06:39 GMT
I'm using a subclass of TCL's CDataFile but I would like
to write a couple of resources to the file as well.
Is this a no-no? I don't see any obvious way to do it?
Any help would be appreciated!
Ian Dowell
idowell@bbn.com
Path: ucivax!gateway
From: kirk_crawford@qmail2.aero.org (Kirk Crawford)
Subject: Re: Re- Re- How do I get Tim
Message-ID: <9403031633.aa22805@q2.ics.uci.edu>
Posted-Date: 3 Mar 94 16:33:10 U
Newsgroups: fa.think-c
X-Message-ID: <199403040033.AA24071@aerospace.aero.org>
Approved: usenet@q2.ics.uci.edu
Lines: 103
Date: 4 Mar 94 00:33:24 GMT
Subject: RE>Re: Re- How do I get Time Z
Well, I answered my own question. I wanted to get the city name and GMT offset
from the Map control panel. With Pete Resnick's help and some ResEdit hacking,
I figured out how to get the city name. Here is the code if anyone is
interested:
/************************************************************************/
/* GetCityAndGMT - This routine will return the name of the city and */
/* the GMT offset in seconds that the macintosh is set to. It searches */
/* the list stored in the MAP control panel. Requires Sys 7 and Find Folder */
/* requires <folders.h> and <GestaltEqu.h> and <script.h> */
typedef struct MyMachineLocation {
Fract latitude;
Fract longitude;
struct {
long dlsDelta : 8;
long gmtDelta : 24;
} gmtFlags;
}MyMachineLocation;
void GetCityAndGMT(unsigned char *City,long *GMTOffset)
{
Str255 FolderName;
long Attrib,
DirID;
short err,
ResRef,
HasFindFolder=0,
vRefNum;
unsigned short NumCitys,
*usptr;
unsigned char *ucptr,
*ucptr2;
Handle h;
MyMachineLocation loc;
unsigned long ByteCount;
long *lptr;
/* find out where we are */
ReadLocation((MachineLocation *)&loc);
/* see if they have Find Folder */
if(!(err = Gestalt(gestaltFindFolderAttr,&Attrib)))
HasFindFolder = (Attrib & (1L << gestaltFindFolderPresent));
/* can't find the control panels folder */
if(!HasFindFolder)
return;
/* find the folder (gMac is a previously filled SysEnvirons structure) */
if((err =
FindFolder(gMac.sysVRefNum,kControlPanelFolderType,kOnSystemDisk,&vRefNum,&DirID)))
return;
/* open the resource file */
if((ResRef = HOpenResFile(vRefNum,DirID,"\pMap",fsRdPerm)) == -1)
return;
/* use the res file */
UseResFile(ResRef);
/* get the list of citys */
if(!(h = GetResource('CTY#',-4064))){
CloseResFile(ResRef);
return;
}
/* lock the handle */
HLock(h);
/* null out the city */
*City = 0;
/* find out how many cities there are */
usptr = (unsigned short *)*h;
NumCitys = *usptr;
/* point to the data */
ucptr = (unsigned char *)*h;
ucptr += sizeof(unsigned short);
/* loop for each city */
while(NumCitys--){
/* point to the latitude and longitude */
ucptr2 = ucptr;
ucptr += 18; /* skip ahead to the city name */
ucptr2 += 2; /* skip a word */
lptr = (long *)ucptr2; /* lat and long are longs */
if(loc.latitude == *lptr++){ /* is the city the same lat as ours? */
if(loc.longitude == *lptr){ /* is it the same longitude? */
ByteCount = *ucptr + 1; /* it is, copy the name */
BlockMove(ucptr,City,ByteCount);
break; /* and get out of here */
}
}
/* skip past the end of the string */
if(*ucptr & 0x01) /* it is odd */
ucptr += *ucptr + 1;
else
ucptr += *ucptr + 2;
}
HUnlock(h); /* don't forget to unlock those handles */
ReleaseResource(h); /* and release the resource */
CloseResFile(ResRef); /* and close the res file */
*GMTOffset = loc.gmtFlags.gmtDelta; /* store the GMT delta */
}
Path: ucivax!gateway
From: mauricio@mozart.aero.ufl.edu (Mauricio Tavares)
Subject: matrix functions
Message-ID: <9403031953.aa02904@q2.ics.uci.edu>
X-Mailer: ELM [version 2.3 PL2]
Newsgroups: fa.think-c
X-Message-ID: <9403040353.AA28773@mozart.aero.ufl.edu>
Approved: usenet@q2.ics.uci.edu
Lines: 3
Date: 4 Mar 94 03:53:42 GMT
Does anyone know where in the net I can find matrix manipulation
code in C? I need specifically a function that can a system of equation
whose left-hand side is a banded matrix. Suggestions?
Path: ucivax!gateway
From: blumenau@campanile.eecs.berkeley.edu ("Trevor I. Blumenau")
Subject: QuickTime import
Message-ID: <9403040145.aa17634@q2.ics.uci.edu>
Newsgroups: fa.think-c
X-Message-ID: <199403040944.BAA00641@campanile.eecs.berkeley.edu>
Approved: usenet@q2.ics.uci.edu
Lines: 13
Date: 4 Mar 94 09:45:05 GMT
I know QuickTime can import certain file formats automatically. For
example, if you open a _sound_ file using GetFilePreview, you're
automatically prompted with a "convert" dialog box. I think the same
is true for an _AIFF_ file.
Does anyone have a comprehensive list of the formats that are recognized
and automatically converted? (If possible, I'd like a list for QT 1.6
as well as QT 2.0.)
Your help is much appreciated.
Trevor
blumenau@eecs.berkeley.edu
Path: ucivax!gateway
From: bkirsch@nadc.nadc.navy.mil ("B. Kirsch")
Subject: Re: matrix functions
Message-ID: <9403040558.aa10991@q2.ics.uci.edu>
Newsgroups: fa.think-c
X-Message-ID: <9403041356.AA13702@NADC.NADC.NAVY.MIL>
Approved: usenet@q2.ics.uci.edu
Lines: 4
Date: 4 Mar 94 13:58:20 GMT
Try Numerical Recipes in C. Also, there is netlib. Send a message to
netlib@ornl.gov with the line send help (I think) or send list (I think).
Barry Kirsch
Path: ucivax!gateway
From: mike.nowak@aoce.itd.umich.edu (Mike Nowak)
Subject: Re(2): Re- Re- How do I get Tim
Message-ID: <9403040603.aa11384@q2.ics.uci.edu>
Newsgroups: fa.think-c
X-Message-ID: <9403040603.aa11384@q2.ics.uci.edu>
Approved: usenet@q2.ics.uci.edu
Lines: 17
Date: 4 Mar 94 14:03:57 GMT
Thanks for sending the code, Kirk. With System 7.1 (and later?), there's a
date and time control panel. I wonder if the Map functionality will be
integrated into this control panel in the future.
Mike.
------ From: Kirk Crawford, Thu, Mar 3, 1994 ------
Subject: RE>Re: Re- How do I get Time Z
Well, I answered my own question. I wanted to get the city name and GMT
offset
from the Map control panel. With Pete Resnick's help and some ResEdit
hacking,
I figured out how to get the city name. Here is the code if anyone is
interested:
Path: ucivax!gateway
From: boudinot@bobby.iaf.cnrs-gif.fr
Subject: MacTCP programming
X-Sender: boudinot@bobby.iaf.cnrs-gif.fr (Unverified)
Message-ID: <9403040649.aa13201@q2.ics.uci.edu>
Newsgroups: fa.think-c
X400-Received: by /PRMD=cicb/ADMD=atlas/C=FR/;
Relayed; 04 Mar 94 15:48:50+0100
X400-Received: by /PRMD=cnrs-gif/ADMD=0/C=fr/;
Relayed; 04 Mar 94 15:48:41+0100
X-Message-ID: <762792521.18382.0-hermes.cnrs-gif.fr*@MHS>
Approved: usenet@q2.ics.uci.edu
Lines: 15
Date: 4 Mar 94 14:49:02 GMT
As an exercise, I am porting MPing 1.1_Sept25_1991 (seeding.apple.com)
from MPW to Think C 6.0.1. The compilation is OK, but at run time the
function OpenResolver fails with a return code of -1.
Does anyone have any suggestions?, Where can I get MacTCP functions
descriptions.
Thanks,
----------------------------------------------------------------------
Michel Boudinot CNRS. Institut Alfred Fessard,
Phone: (33-1) 69 82 34 02 Avenue de la Terrasse,
Fax: (33-1) 69 07 05 38 Gif sur Yvette, 91198 Cedex
E-mail: boudinot@bobby.iaf.cnrs-gif.fr France.
----------------------------------------------------------------------
Path: ucivax!gateway
From: brians@fluxes.plk.af.mil ("Brian J. Scamman (WSAI")
Subject: Mac Driver for IBM 3633 Optical Drive
Message-ID: <9403040802.aa16228@q2.ics.uci.edu>
Newsgroups: fa.think-c
X-Message-ID: <9403041601.AA09579@fluxes.plk.af.mil.plk.af.mil>
Approved: usenet@q2.ics.uci.edu
Lines: 11
Date: 4 Mar 94 16:02:26 GMT
I tried to post this to "News" but it never showed up. Perhaps this group can
help.
I'm looking for any Macintosh drivers for an IBM 3633 Optical Drive.
Technical Specs (including wiring and low-level signals) would be very
helpful.
Please send responses to: brians@fluxes.plk.af.mil
Thanks
Path: ucivax!gateway
From: nagel@barracuda.rdatasys.com ("Mark D. Nagel")
Subject: ADMIN: send administrative requests to think-c-request
Message-ID: <9403041008.aa24241@q2.ics.uci.edu>
Newsgroups: fa.think-c
X-Message-ID: <28397.762804136@barracuda>
Reply-To: nagel@rdatasys.rdatasys.com
Approved: usenet@q2.ics.uci.edu
Organization: Relational Data Systems, Irvine, CA
Lines: 8
Date: 4 Mar 94 18:08:36 GMT
Phone: (714) 263-3899
It seems some people have forgotten again that administrative
requests, such as unsubscribe messages, should be sent to
think-c-request@ics.uci.edu. Sending them to think-c will only
dribble useless information into hundreds of mailboxes. Please send
them to the one mailbox that will actually accomplish something.
Thanks,
Mark
Path: ucivax!gateway
From: askwersk@mit.edu
Subject: Re: matrix functions
Message-ID: <9403041656.aa14897@q2.ics.uci.edu>
In-Reply-To: Your message of 04 Mar 94 13:58:20 +0000.
<9403040558.aa10991@q2.ics.uci.edu>
Newsgroups: fa.think-c
X-Message-ID: <9403041938.AA26929@bolognese.MIT.EDU>
Approved: usenet@q2.ics.uci.edu
Lines: 12
Date: 5 Mar 94 00:56:51 GMT
I wrote some of my own matrix manipulation functions. They were derived
from Numerical recipes in C, but remember that Numerical recipes in
C uses "malloc" to allocate space for vectors and matrixes. Its a simple
matter to convert all the malloc's to NewPtr's though. If you plan on using
their integrator functions (runge kutta, etc), you might want change all
the "floats" into "double". I had problem when I tried to use those functions
but when I changed all the floats into doubles, it worked fine.
Adam
Path: ucivax!gateway
From: chharris@u.washington.edu (The Only Cow)
Subject: Offscreen Graphics
X-Sender: chharris@stein3.u.washington.edu
Message-ID: <9403042021.aa29037@q2.ics.uci.edu>
Content-Type: TEXT/PLAIN; charset=US-ASCII
Mime-Version: 1.0
Newsgroups: fa.think-c
X-Message-ID: <Pine.3.89.9403042029.A3767-0100000@stein3.u.washington.edu>
Approved: usenet@q2.ics.uci.edu
Lines: 24
Date: 5 Mar 94 04:21:19 GMT
Hello Folks,
I'm trying to write a little game here that allows you to move a
ship around the screen in responce to various key presses. The movement
basically works okay, but there is lots o' flicker, because it uses
DrawPicture() every time it updates....
From what I've heard, I should draw the picture somehow off screen
and then copy it back to whatever window with CopyBits().
I looked through Think Reference and there seems to be a few
different ways to impliment offscreen graphics, but I can't seem to
figure out which one to use. I tried copying the source code from one of
the examples, but I wasn't able to get it to work.
If anybody has any good commented code for creating offscreen
graphics, please let me know.
Thanks.
-Chris
------------------------------------------------------------------------------
"To error is human, but to really foul things up, you need a computer."
Send questions, comments, flames, etc. to:
Chris Harris / chharris@stein.u.washington.edu
PGP Signature availible via finger...
Path: ucivax!gateway
From: resnick@cogsci.uiuc.edu (Pete Resnick)
Subject: Re: MacTCP programming
X-Sender: resnick@tarski.cogsci.uiuc.edu
Message-ID: <9403042112.aa01247@q2.ics.uci.edu>
Content-Type: text/plain; charset="us-ascii"
Mime-Version: 1.0
Newsgroups: fa.think-c
X-Message-ID: <199403050511.AA20022@tarski.cogsci.uiuc.edu>
Approved: usenet@q2.ics.uci.edu
Lines: 25
Date: 5 Mar 94 05:12:03 GMT
At 2:49 PM 3/4/94 +0000, boudinot@bobby.iaf.cnrs-gif.fr wrote:
>As an exercise, I am porting MPing 1.1_Sept25_1991 (seeding.apple.com)
>from MPW to Think C 6.0.1. The compilation is OK, but at run time the
>function OpenResolver fails with a return code of -1.
Make sure that you have either prototypes turned on, or that you make all
of the #define's for the numeric constants longs by putting an "L" after
each number. The DNR header files are fraught with difficulty in THINK C.
There is a compilation of diffs between the files somewhere.
>Does anyone have any suggestions?, Where can I get MacTCP functions
>descriptions.
Take a look by anonymous FTP at seeding.apple.com. There is a directory
that contains the Programmers manual and the header files.
pr
--
Pete Resnick (...so what is a mojo, and why would one be rising?)
Graduate assistant - Philosophy Department, Gregory Hall, UIUC
System manager - Cognitive Science Group, Beckman Institute, UIUC
Internet: resnick@cogsci.uiuc.edu
Path: ucivax!gateway
From: rmah@panix.com ("Robert S. Mah")
Subject: Re: MacTCP programming
Message-ID: <9403050012.aa08002@q2.ics.uci.edu>
Content-Type: text/plain; charset="us-ascii"
Mime-Version: 1.0
Newsgroups: fa.think-c
X-Message-ID: <199403050811.AA09146@panix.com>
Approved: usenet@q2.ics.uci.edu
Lines: 21
Date: 5 Mar 94 08:12:15 GMT
At 2:49 PM 3/4/94 +0000, boudinot@bobby.iaf.cnrs-gif.fr wrote:
>As an exercise, I am porting MPing 1.1_Sept25_1991 (seeding.apple.com)
>from MPW to Think C 6.0.1. The compilation is OK, but at run time the
>function OpenResolver fails with a return code of -1.
>Does anyone have any suggestions?, Where can I get MacTCP functions
>descriptions.
If I recall correctly, there's a bug in the early MacTCP headers.
Something to do with using "int" instead of "long" or something like that.
It is covered in a Tech Note and was fixed in the latest MacTCP headers
(available at seeding.apple.com).
Hope this helps.
Cheers,
Rob
____________________________________________________________________________
Robert S. Mah One Step Beyond rmah@panix.com
Path: ucivax!gateway
From: bhamlin@well.sf.ca.us ("Brian M. Hamlin")
Subject: Re: Re- Re- How do I get Tim
Message-ID: <9403050944.aa13503@q2.ics.uci.edu>
Newsgroups: fa.think-c
X-Message-ID: <199403051739.JAA00748@well.sf.ca.us>
Approved: usenet@q2.ics.uci.edu
Lines: 3
Date: 5 Mar 94 17:44:02 GMT
One thing you might want to know is that FindFolder() works under
System 6, if thats what you are worried about....
Path: ucivax!gateway
From: bin@primate.wisc.edu (Brain in Neutral)
Subject: converting FSOpen() file pointer to stdio pointer?
Message-ID: <9403061633.aa22877@q2.ics.uci.edu>
X-Mailer: ELM [version 2.4 PL21]
Content-Type: text
Content-Length: 310
Newsgroups: fa.think-c
X-Message-ID: <9403070033.AA26303@saimiri.primate.wisc.edu>
Approved: usenet@q2.ics.uci.edu
Lines: 10
Date: 7 Mar 94 00:33:14 GMT
Is there a way in THINK C (6) to convert a file reference number
such as that returned by FSOpen() or FSpOpenDF() and convert it
to a FILE * pointer such as that returned by fopen()? I want
to open a data file using Macintosh OS calls but read the thing
using stdio.
Paul DuBois
dubois@primate.wisc.edu
--
Path: ucivax!gateway
From: jaha@secrc.abb.se ("Jan R. M. Rohman")
Subject: ???
Message-ID: <9403070742.aa10040@q2.ics.uci.edu>
Newsgroups: fa.think-c
X-Message-ID: <9403071537.AA03063@kbmhp1.secrc.abb.se>
Reply-To: jaha@secrc.abb.se
Approved: usenet@q2.ics.uci.edu
Lines: 11
Date: 7 Mar 94 15:42:45 GMT
How do I know if a user only use black & white on a color monitor?
----------------------------------------------------------------------
From: jaha@secrc.abb.se Jan R. M. Rohman !
Phone: +46 21 32 31 48 ABB Corporate Research Center Dept. KF !
Fax: +46 21 32 31 01 Department of Computational Methods, !
Electromagnetic Fields and Fluid Dynamics !
S-721 78 Vasteras, SWEDEN !
Home: Vasagatan 35, 722 15 Vasteras, Phone: +46 21 83 06 00 !
----------------------------------------------------------------------
Path: ucivax!gateway
From: KFISCHER@arac.llnl.gov (Kathleen Fischer)
Subject: memcpy question (probably a stupid one!)
Message-ID: <9403070808.aa11492@q2.ics.uci.edu>
Newsgroups: fa.think-c
X-Message-ID: <01H9OME2J1OG000PIS@addvax.llnl.gov>
Approved: usenet@q2.ics.uci.edu
X-VMS-To: addvax::in%"think-c@ics.uci.edu"
Lines: 14
Date: 7 Mar 94 16:08:33 GMT
X-Envelope-to: think-c@ics.uci.EDU
Ok ... I have JUST started programming using Symantic C++ and I began by using
a small program from my C++ class (I'm very new to C++, but know C). This
program uses memcpy() ... a familiar old C routine.
However, the linker yells at me saying that the routine doesn't exit even though
I have found it (in mem.c) and it is included in ANSI++ lib which I have
included in my project. On top of that, I did a search and discovered that
fwrite() (I think that was the routine) also calls memcpy(), so I made a test
call to fwrite, commenting out my memcpy() and the linker was happy. I have
checked my input args to memcpy and they are fine...so what
gives?
Help!
Kathleen
Path: ucivax!gateway
From: Jean-Marie.Laborde@imag.fr (Jean-Marie Laborde)
Subject: Re: B&W or not
X-Sender: laborde@isis.imag.fr
Message-ID: <9403071057.aa23548@q2.ics.uci.edu>
Content-Type: text/plain; charset="us-ascii"
Mime-Version: 1.0
Newsgroups: fa.think-c
X-Message-ID: <199403071857.AA17303@isis.imag.fr>
Approved: usenet@q2.ics.uci.edu
Lines: 31
Date: 7 Mar 94 18:57:22 GMT
A possible way is to ask if the red (rouge) color is available
{
Boolean MDevBandW;
RGBColor rougeStd;
rougeStd.red =0xDD6B;
rougeStd.green =0x08C2;
rougeStd.blue =0x06A2;
MDevGray=!RealColor(&rougeStd);
.....
}
I would have another question.
How to know if the user has a Real Gray-scale Monitor or is not only
working on a Color Monitor switched to Gray or B&W?
Indeed the rendering of colors is much more crispy
on a real gray-scale than with approximated grays on a Color Monitor when
colors are turned off!
****************************************************************************
Jean-Marie Laborde jean-marie.laborde@imag.fr
Responsable du Projet IMAG Cabri-geometre
Laboratoire de Structures Discretes et de Didactique - IMAG
Universite Joseph Fourier - CNRS BP 53 38041 Grenoble cedex 9 FRANCE
(33) 76 51 46 10 (sec 76 51 46 16) (fax 76 51 45 55)
****************************************************************************
Path: ucivax!gateway
From: ribtm@ttacs1.ttu.edu (Greg Vaughn)
Subject: TransSkel users?
Message-ID: <9403071100.aa23868@q2.ics.uci.edu>
Content-transfer-encoding: 7BIT
Content-type: text/plain; charset="us-ascii"
MIME-version: 1.0
Newsgroups: fa.think-c
X-Message-ID: <01H9OWLJEBUQ9D4O7T@ttacs.ttu.edu>
Approved: usenet@q2.ics.uci.edu
Lines: 22
Date: 7 Mar 94 19:00:54 GMT
I'm hoping someone on this list has experience using the TransSkel 3.10
application skeleton maintained by Paul DuBois with Think C 6.0.1 and is
willing to help me out. I'm also hoping to avoid bothering Paul directly
since he has already put a lot of time and effort into TS.
I want to put dialog controls in part of a window that I also draw in. I'm
hoping that I can do it in TS, but I'm not sure. I'm new to Mac programming
and only have the SpInside Mac Hypercard stacks available, so I was hoping
to use TS to make my job easier.
If anyone is familiar with doing this in TS (fat chance I know, but I
thought I'd try) please e-mail me so I can talk it over with you.
Thanks
______
/\__ _\ | Greg Vaughn
\/_/\ \/ exas | Grad Student, Dept. of Physics
\ \_\ ech University | Insulator Research Laboratory
\/_/ Lubbock, Texas | E-Mail: ribtm@ttacs.ttu.edu
Path: ucivax!gateway
From: bin@primate.wisc.edu (Brain in Neutral)
Subject: Re: TransSkel users?
Message-ID: <9403080820.aa11944@q2.ics.uci.edu>
In-Reply-To: <9403071100.aa23868@q2.ics.uci.edu> from "Greg Vaughn" at Mar 7, 94 07:00:54 pm
X-Mailer: ELM [version 2.4 PL21]
Content-Type: text
Content-Length: 1087
Newsgroups: fa.think-c
X-Message-ID: <9403081619.AA18700@saimiri.primate.wisc.edu>
Approved: usenet@q2.ics.uci.edu
Lines: 23
Date: 8 Mar 94 16:20:15 GMT
>I'm hoping someone on this list has experience using the TransSkel 3.10
>application skeleton maintained by Paul DuBois with Think C 6.0.1 and is
>willing to help me out. I'm also hoping to avoid bothering Paul directly
>since he has already put a lot of time and effort into TS.
Actually, I'm happy to get questions, since although people grab TransSkel
from my ftp machine every day, it's very rare that I get any kind of feedback
on it. I figure most people take a brief look and drag it to the trash.
>I want to put dialog controls in part of a window that I also draw in. I'm
>hoping that I can do it in TS, but I'm not sure. I'm new to Mac programming
>and only have the SpInside Mac Hypercard stacks available, so I was hoping
>to use TS to make my job easier.
It's not clear to me what you're trying to do. Is the window a dialog
window? If so, there are a lot of TransSkel calls for this kind of thing.
If it's not a dialog window, I'm not sure what you mean by "dialog controls",
unless you just mean controls. Please clarify.
Paul DuBois
dubois@primate.wisc.edu
--
Path: ucivax!gateway
From: josh@dapsun.lif.icnet.uk (Joshua Kafeero)
Subject: Desperately need help with GetClip()
Message-ID: <9403080902.aa14736@q2.ics.uci.edu>
Newsgroups: fa.think-c
X-Message-ID: <2liaqk$2hp@nagos.lif.icnet.uk>
Approved: usenet@q2.ics.uci.edu
Organization: Imperial Cancer Research Fund
Lines: 19
Date: 8 Mar 94 17:02:39 GMT
To whoever could give me some help with GetClip()
I am having a problem with using the Handle data type in Think C++
(Symantec).
I have the declaration:
RgnHandle oldClip;
and later on I try to do :
GetClip(oldClip);
The code compile ok. but on running the system simply freezes.
Would anyone kindly give me some help with this problem.
Josh.
Path: ucivax!gateway
From: Brian.Bezanson@macsrv.mgi.com (Brian Bezanson)
Subject: RE>Desperately need help with GetClip()
Message-ID: <9403081235.aa29142@q2.ics.uci.edu>
X-Mailer: InterCon Dispatcher/SMTP for QuickMail
Newsgroups: fa.think-c
X-Message-ID: <199403081435434999@macsrv.mgi.com>
Approved: usenet@q2.ics.uci.edu
X-Priority: 4
Lines: 55
Date: 8 Mar 94 20:35:12 GMT
Date 3/8/94
Subject RE>Desperately need help wi
From Brian Bezanson
To think-c
Reply to: RE>Desperately need help with GetClip()
>To whoever could give me some help with GetClip()
>
>I am having a problem with using the Handle data type in Think C++
>(Symantec).
>
>I have the declaration:
>
>RgnHandle oldClip;
>
>and later on I try to do :
>
>GetClip(oldClip);
>
>The code compile ok. but on running the system simply freezes.
>
>Would anyone kindly give me some help with this problem.
>
>Josh.
>
You need to add in between the line
oldClip = NewRgn();
You need to allocate a Region before calling commands that use a destination
region.
Here's a code sample from THINK Reference (buy it if you don't have it).
/* CODE EXAMPLE #1 */
saveClipRgn = NewRgn(); /* get an empty region */
GetClip( saveClipRgn ); /* save current */
SetClip( myClipRgn ); /* install desired clipRgn */
/*... ( draw a figure ) ... */
SetClip( saveClipRgn ); /* restore previous value */
DisposeRgn( saveClipRgn ); /* not needed any more */
====
Brian R Bezanson Phone: +1 612 854 1220
Management Graphics, Inc. Fax: +1 612 851 6159
1401 E 79th Street internet: bezanson@mgi.com
Minneapolis, MN 55425 AppleLink: BEZANSON
Path: ucivax!gateway
From: rmah@panix.com ("Robert S. Mah")
Subject: Re: Desperately need help with GetClip()
Message-ID: <9403081236.aa29393@q2.ics.uci.edu>
Content-Type: text/plain; charset="us-ascii"
Mime-Version: 1.0
Newsgroups: fa.think-c
X-Message-ID: <199403082036.AA16955@panix.com>
Approved: usenet@q2.ics.uci.edu
Lines: 33
Date: 8 Mar 94 20:36:31 GMT
At 5:02 PM 3/8/94 +0000, Joshua Kafeero wrote:
>
>I have the declaration:
>
>RgnHandle oldClip;
>
>and later on I try to do :
>
>GetClip(oldClip);
>
>The code compile ok. but on running the system simply freezes.
GetClip() simply copies the current clipping region into the region you
pass to it. Thus, the region you pass to it, "oldClip" must have already
been created.
So, do something like the following...
RgnHandle oldClip;
oldClip = NewRgn(); // you should check for NULL here
GetClip( oldClip );
...
SetClip( oldClip );
DisposeRgn( oldClip );
Cheers,
Rob
____________________________________________________________________________
Robert S. Mah One Step Beyond rmah@panix.com
Path: ucivax!gateway
From: mike.nowak@aoce.itd.umich.edu (Mike Nowak)
Subject: Re: Desperately need help with GetClip()
Message-ID: <9403081312.aa01585@q2.ics.uci.edu>
Newsgroups: fa.think-c
X-Message-ID: <9403081312.aa01585@q2.ics.uci.edu>
Approved: usenet@q2.ics.uci.edu
Lines: 33
Date: 8 Mar 94 21:12:45 GMT
I think you have to allocate the region first. Try:
RgnHandle oldClip;
oldCip = NewRgn();
GetClip(oldClip);
...
SetClip(oldClip);
DisposeRgn(oldClip); // I think you need to do this...
------ From: Joshua Kafeero, Tue, Mar 8, 1994 ------
To whoever could give me some help with GetClip()
I am having a problem with using the Handle data type in Think C++
(Symantec).
I have the declaration:
RgnHandle oldClip;
and later on I try to do :
GetClip(oldClip);
The code compile ok. but on running the system simply freezes.
Would anyone kindly give me some help with this problem.
Josh.
Path: ucivax!gateway
From: gurgle@netcom.com (Pete Gontier)
Subject: Re: Desperately need help with GetClip()
Message-ID: <9403081433.ab07832@q2.ics.uci.edu>
In-Reply-To: <9403080902.aa14736@q2.ics.uci.edu> from "Joshua Kafeero" at Mar 8, 94 05:02:39 pm
X-Mailer: ELM [version 2.4 PL23]
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset=US-ASCII
Content-Length: 428
MIME-Version: 1.0
Newsgroups: fa.think-c
X-Message-ID: <199403082233.OAA21082@netcom9.netcom.com>
Approved: usenet@q2.ics.uci.edu
Lines: 15
Date: 8 Mar 94 22:33:15 GMT
> RgnHandle oldClip;
> GetClip(oldClip);
>
> The code compile ok. but on running the system simply freezes.
The problem is not with handles or region handles. You need to do this:
RgnHandle oldClip = NewRgn ( );
GetClip (oldClip);
The error-checking for this code is missing; you should check to see if
NewRgn returned 0 and do something appropriate if so.
--
Pete Gontier, CTO, Integer Poet Software; gurgle@netcom.com
Path: ucivax!gateway
From: dnebing@andy.bgsu.edu (Dave Nebinger)
Subject: SCGetUserNameRec vs Parameter Error (fight to the death)
Message-ID: <9403082009.aa26513@q2.ics.uci.edu>
Content-type: text/plain; charset="us-ascii"
Mime-Version: 1.0
Newsgroups: fa.think-c
X-Message-ID: <01H9QW62OFZ40037GZ@opie.bgsu.edu>
Approved: usenet@q2.ics.uci.edu
Lines: 80
Date: 9 Mar 94 04:09:59 GMT
X-Envelope-to: think-c@ics.uci.EDU
In the following code which I have attached below, I am having a problem
using the SCGetUserNameRec call. When I make the SyncServerDispatch call,
I always get an OSErr value of -50 (parameter error).
I am running a IIci running system 7.1 with local file sharing running and
one person logged into the mac. The code follows. Anyone using the
AppleShare lib who can figure out where the problem is will be awarded a
bottle of YooHoo. ;-)
Thanks in advance,
Dave Nebinger.
/*
GetUsersTest.c
Prints out the names of all the connected users.
03/08/94 dn - Created.
*/
#include <stdio.h>
#include <console.h>
#include <LibTraps.h>
#include <LibInit.h>
#include "ServerControlIntf.h"
/* Prototypes */
void main(void);
void GetUsers(void);
void main(){
int argc;
char** argv;
argc=ccommand(&argv);
if (TrapAvailable(ServerDispatch)){
GetUsers();
}
}
void GetUsers(){
OSErr err;
Str31 userName;
long Position;
SCParamBlockRec scPB;
printf("\n\nListing all connected users...\n\n");
Position=0L;
err=noErr;
do {
scPB.userInfoPB.scCode=SCGetUserNameRec;
scPB.userInfoPB.scNamePtr=userName;
scPB.userInfoPB.scPosition=Position;
err=SyncServerDispatch(&scPB);
if (err==noErr)
printf(" %#s\n",userName);
else
if (err!=fnfErr) // fnfErr indicates no more users
printf("\n\n Unexpected error %d.\n",err);
} while (err==noErr);
}
============================================================
Dave Nebinger dnebing@andy.bgsu.edu
Network Manager, Biology Dept. dnebing@opie.bgsu.edu
Bowling Green State University dnebing@bgsuopie (bitnet)
Bowling Green, OH 43403 #include <std_disclaimer.h>
*THE* alt.sources.mac supporter!
Path: ucivax!gateway
From: rmah@panix.com ("Robert S. Mah")
Subject: Re: SCGetUserNameRec vs Parameter Error (fight to the death)
Message-ID: <9403090324.aa12867@q2.ics.uci.edu>
Content-Type: text/plain; charset="us-ascii"
Mime-Version: 1.0
Newsgroups: fa.think-c
X-Message-ID: <199403091121.AA12679@panix.com>
Approved: usenet@q2.ics.uci.edu
Lines: 31
Date: 9 Mar 94 11:24:31 GMT
Dave,
At 4:09 AM 3/9/94 +0000, Dave Nebinger wrote:
> In the following code which I have attached below, I am having a problem
> using the SCGetUserNameRec call. When I make the SyncServerDispatch call,
> I always get an OSErr value of -50 (parameter error).
Do you get this the _first_ time you call ServerDispatch? If so, I'm not
sure what the problem is, but if the error occurs _after_ the first time, I
think it's because you are resetting scPosition to 0 every time. You
should leave scPosition alone between calls to ServerDispatch as
ServerDispatch returns the position of the next user in scPosition after it
completes.
In other words, try moving the line...
> scPB.userInfoPB.scPosition=Position;
Above the line...
> do {
I'm not absolutely sure here, but everything else looks kosher.
Cheers,
Rob
____________________________________________________________________________
Robert S. Mah One Step Beyond rmah@panix.com
Path: ucivax!gateway
From: bkirsch@nadc.nadc.navy.mil ("B. Kirsch")
Subject: Checking for valid Handle's?
Message-ID: <9403090610.aa02066@q2.ics.uci.edu>
Newsgroups: fa.think-c
X-Message-ID: <9403091408.AA02936@NADC.NADC.NAVY.MIL>
Approved: usenet@q2.ics.uci.edu
Lines: 7
Date: 9 Mar 94 14:10:30 GMT
How do I determine if a handle is valid? If I DisposHandle(theHandle),
may I then assign NIL to theHandle, and then check to see if theHandle is NIL
to determine if it is invalid? I know I can do that with pointers.
Thanks,
Barry Kirsch
bkirsch@nadc.navy.mil
Path: ucivax!gateway
From: huff@mcclb0.med.nyu.edu ("Edward J. Huff")
Subject: Has anyone ported P2C to Think C or MPW?
X-Sender: huff@mcclb0.med.nyu.edu (Unverified)
Message-ID: <9403090719.aa05165@q2.ics.uci.edu>
Content-transfer-encoding: 7BIT
Newsgroups: fa.think-c
X-Message-ID: <01H9RJJ1WH1E00339L@MCCLB0.MED.NYU.EDU>
Approved: usenet@q2.ics.uci.edu
Lines: 7
Date: 9 Mar 94 15:19:28 GMT
X-Envelope-to: think-c@ics.uci.edu
Has anyone taken the P2C translator available on comp.sources.unix volume
21 and used it to convert a Think Pascal program to a Think C (or MPW C)?
--
Edward J. Huff huff@mcclb0.med.nyu.edu (212)998-8465
Keck Laboratory for Biomolecular Imaging
NYU Chemistry Department, 31 Washington Place, New York NY 10003
Path: ucivax!gateway
From: bkirsch@nadc.nadc.navy.mil ("B. Kirsch")
Subject: File locations?
Message-ID: <9403090913.aa12617@q2.ics.uci.edu>
Newsgroups: fa.think-c
X-Message-ID: <9403091710.AA09364@NADC.NADC.NAVY.MIL>
Approved: usenet@q2.ics.uci.edu
Lines: 5
Date: 9 Mar 94 17:13:04 GMT
What is the best method to remember where a file (chosen by the user) is located
for subsequent sessions of the application.
Thanks,
Barry Kirsch
Path: ucivax!gateway
From: bkirsch@nadc.nadc.navy.mil ("B. Kirsch")
Subject: Re: Checking for valid Handle's?
Message-ID: <9403091028.aa18827@q2.ics.uci.edu>
Newsgroups: fa.think-c
X-Message-ID: <9403091826.AA11409@NADC.NADC.NAVY.MIL>
Approved: usenet@q2.ics.uci.edu
Lines: 7
Date: 9 Mar 94 18:28:52 GMT
Thanks for all of your responses. I have part of the answer. I can
assign NULL to the handle variable, but is there any other way to check
if a handle is valid without assigning NULL to it to flag it as not valid.
Thanks,
Barry Kirsch
Path: ucivax!gateway
From: resnick@cogsci.uiuc.edu (Pete Resnick)
Subject: Re: File locations?
Message-ID: <9403091330.aa01867@q2.ics.uci.edu>
In-Reply-To: <9403090913.aa12617@q2.ics.uci.edu>; from "B. Kirsch" at Mar 9, 94 5:13 pm
X-Mailer: ELM [version 2.3 PL11]
Newsgroups: fa.think-c
X-Message-ID: <199403092129.AA25305@tarski.cogsci.uiuc.edu>
Approved: usenet@q2.ics.uci.edu
Lines: 14
Date: 9 Mar 94 21:30:48 GMT
> What is the best method to remember where a file (chosen by the user)
> is located for subsequent sessions of the application.
System 7 - An alias created using the Alias Manager.
System 6 - If you need to save the info, use volume name, dirID, and
file name. If you just need to use it during the current
session, use volume reference number, dirID and file name.
pr
--
Pete Resnick (...so what is a mojo, and why would one be rising?)
Graduate assistant - Philosophy Department, Gregory Hall, UIUC
System manager - Cognitive Science Group, Beckman Institute, UIUC
Internet: resnick@cogsci.uiuc.edu
Path: ucivax!gateway
From: ribtm@ttacs1.ttu.edu (Greg Vaughn)
Subject: Code resources and global variables
Message-ID: <9403091401.ab04610@q2.ics.uci.edu>
Content-transfer-encoding: 7BIT
Content-type: text/plain; charset="us-ascii"
MIME-version: 1.0
Newsgroups: fa.think-c
X-Message-ID: <01H9RVGE08HE9D503H@ttacs.ttu.edu>
Approved: usenet@q2.ics.uci.edu
Lines: 17
Date: 9 Mar 94 22:01:27 GMT
I'm interested in writing a code resource for an iterative mathematical
function to be called every time the program gets a null event, but I'm not
familiar with writing code resources. The function needs to use an iterated
loop counter for calculation, but I want the program to be a good Mac
citizen, so the function is written as a single iteration. I don't want the
counter to be reset each time the function is called so I need to keep it
in a global variable. What, if any, are some of the pitfalls of accessing a
global variable in a code resource?
Thanks
______
/\__ _\ | Greg Vaughn
\/_/\ \/ exas | Grad Student, Dept. of Physics
\ \_\ ech University | Insulator Research Laboratory
\/_/ Lubbock, Texas | Email: ribtm@ttacs.ttu.edu
Path: ucivax!gateway
From: gurgle@netcom.com (Pete Gontier)
Subject: Re: File locations?
Message-ID: <9403091848.aa27819@q2.ics.uci.edu>
In-Reply-To: <9403091330.aa01867@q2.ics.uci.edu> from "Pete Resnick" at Mar 9, 94 09:30:48 pm
X-Mailer: ELM [version 2.4 PL23]
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset=US-ASCII
Content-Length: 740
MIME-Version: 1.0
Newsgroups: fa.think-c
X-Message-ID: <199403100249.SAA23604@mail.netcom.com>
Approved: usenet@q2.ics.uci.edu
Lines: 15
Date: 10 Mar 94 02:48:20 GMT
> > What is the best method to remember where a file (chosen by the user)
> > is located for subsequent sessions of the application.
>
> System 7 - An alias created using the Alias Manager.
> System 6 - If you need to save the info, use volume name, dirID, and
> file name. If you just need to use it during the current
> session, use volume reference number, dirID and file name.
Volume creation date can also be useful under System 6. It's best used
along with volume name, of course. One scheme I implemented saved both,
and (later) looked for the creation date but would settle for the volume
name. If neither were present, it was time to ask the user.
--
Pete Gontier, CTO, Integer Poet Software; gurgle@netcom.com
Path: ucivax!gateway
From: josh@dapsun.lif.icnet.uk (Joshua Kafeero)
Subject: MacTCP programming Guide.
Message-ID: <9403100636.aa08817@q2.ics.uci.edu>
Newsgroups: fa.think-c
X-Message-ID: <2lnavq$2st@nagos.lif.icnet.uk>
Approved: usenet@q2.ics.uci.edu
Organization: Imperial Cancer Research Fund
Lines: 14
Date: 10 Mar 94 14:36:56 GMT
I am looking for a guide to MacTCP programming. There was
something I read about a host: seeding.apple.com. I have
failed to ftp to this site, I get a connection refused
reply.
Is there any source for TCP/IP implementation on the Mac.
I would be very grateful.
Josh.
.
Path: ucivax!gateway
From: josh@dapsun.lif.icnet.uk (Joshua Kafeero)
Subject: Whatever happened to seeding.apple.com ???
Message-ID: <9403100639.aa08930@q2.ics.uci.edu>
Newsgroups: fa.think-c
X-Message-ID: <2lnb6c$2t5@nagos.lif.icnet.uk>
Approved: usenet@q2.ics.uci.edu
Organization: Imperial Cancer Research Fund
Lines: 12
Date: 10 Mar 94 14:39:28 GMT
I have been trying to get to the above host for
a guide on MacTCP programming but have my connection
attempts with ftp refused.
I need some info on TCP/IP implementation on the Mac
is there anyone out there who knows of any other
source?
Josh.
.
Path: ucivax!gateway
From: josh@dapsun.lif.icnet.uk (Joshua Kafeero)
Subject: Whatever happened to seeding.apple.com ????
Message-ID: <9403100640.aa09017@q2.ics.uci.edu>
Newsgroups: fa.think-c
X-Message-ID: <2lnb94$2t9@nagos.lif.icnet.uk>
Approved: usenet@q2.ics.uci.edu
Organization: Imperial Cancer Research Fund
Lines: 11
Date: 10 Mar 94 14:40:33 GMT
I have been trying to get to the above host for
a guide on MacTCP programming but have my connection
attempts with ftp refused.
I need some info on TCP/IP implementation on the Mac
is there anyone out there who knows of any other
source?
Josh.
Path: ucivax!gateway
From: gurgle@netcom.com (Pete Gontier)
Subject: Re: MacTCP programming Guide.
Message-ID: <9403100846.aa14406@q2.ics.uci.edu>
In-Reply-To: <9403100636.aa08817@q2.ics.uci.edu> from "Joshua Kafeero" at Mar 10, 94 02:36:56 pm
X-Mailer: ELM [version 2.4 PL23]
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset=US-ASCII
Content-Length: 1131
MIME-Version: 1.0
Newsgroups: fa.think-c
X-Message-ID: <199403101646.IAA11325@netcom9.netcom.com>
Approved: usenet@q2.ics.uci.edu
Lines: 20
Date: 10 Mar 94 16:46:19 GMT
> I am looking for a guide to MacTCP programming. There was something
> I read about a host: seeding.apple.com. I have failed to ftp to this
> site, I get a connection refused reply. Is there any source for TCP/IP
> implementation on the Mac.
A few months ago I got the same tip and downloaded a MacTCP API
document. It's in DocViewer format, by the way. I was all excited to
read this document, but it blew up when I tried to open it. I made sure
I had the latest DocViewer and tried again. Again it blew up. So I went
and downloaded another copy of the document from the server. This copy
blew up, too. Frustrated, I sent a note to the responsible party at the
site, but I can't remember ever getting anything back. Anyway, this
is all by way of saying you *may* not be missing out on anything. And
if anyone has this document and it doesn't blow up when you read it,
I'm not suggesting you send it to me (because that would probably be
against Apple's silly redistribution license), but I have a writable
'ftp' directory: 'ftp.netcom.com:/pub/gurgle/incoming'.
--
Pete Gontier, CTO, Integer Poet Software; gurgle@netcom.com
Path: ucivax!gateway
From: mauricio@mozart.aero.ufl.edu (Mauricio Tavares)
Subject: And now for something completely different
Message-ID: <9403100857.aa15084@q2.ics.uci.edu>
In-Reply-To: <9402281838.aa19798@q2.ics.uci.edu>; from "Lance Helsten" at Mar 1, 94 2:38 am
X-Mailer: ELM [version 2.3 PL2]
Newsgroups: fa.think-c
X-Message-ID: <9403101657.AA11968@mozart.aero.ufl.edu>
Approved: usenet@q2.ics.uci.edu
Lines: 35
Date: 10 Mar 94 16:57:22 GMT
First, some good news. My code that uses the Newton-Raphson method
works! In fact, I already generated the needed data and sent my paper to
the AIAA student conference. Now, I have only to prepare my transparencies
and wait for the presentation day. :)
So, now that the code finally works, I can go back to my aventures in
toolbox programming. In the previous chapter, my problems with modal
dialogs and normal windows have been solved. Nevertheless, I am still
wondering whether I should put my controls in a modeless dialog or in the
window itself. For the sake of today's problem, let's just say I will try
to put them in the modeless dialog. I used "try" since it does not work
according to the plan.
Initially, I was going to put the modeless dialog on screen in the
beginning. So, my algo is something like this:
DialogPtr gMyDialog; /* Global, defined somewhere else */
gMyDialog = GetNewDialog(dialogID, NIL_POINTER, MOVE_TO_FRONT);
ShowWindow(gMyDialog);
and that is about it. Since I don't have any use for the dialog yet -- I
just wanted to see it on the screen -- I did not bother about
IsDialogEvent() and such. Well, when I run the code I have the dialog
window on the screen but with none of its items (buttons, static text, PICT
resource) visible. If I click on the dialog, the system crashes. If I
open my window (that one I created in the previous chapter) AND THEN click
on the dialog, nothing happens (no crashes). Suggestions?
OLD SHRAPNELL
--- ---------
When should I allocate space for a window I will be creating and destrying
throughout my code: in the beginning of the code or when I need it?
Path: ucivax!gateway
From: morris@wais.com (Harry Morris)
Subject: unsubscribe morris@wais.com
Message-ID: <9403101018.aa20210@q2.ics.uci.edu>
Newsgroups: fa.think-c
X-Message-ID: <9403101818.AA01251@sushi>
Approved: usenet@q2.ics.uci.edu
Lines: 2
Date: 10 Mar 94 18:18:52 GMT
unsubscribe morris@wais.com
Path: ucivax!gateway
From: FEATS@vtvm1.cc.vt.edu (Steve Greenfield)
Subject: CopyBits (Off-Screen to Print)
Message-ID: <9403101230.aa00559@q2.ics.uci.edu>
Newsgroups: fa.think-c
X-Message-ID: <9403101230.aa00559@q2.ics.uci.edu>
Approved: usenet@q2.ics.uci.edu
Lines: 47
Date: 10 Mar 94 20:30:33 GMT
I have written a routine which creates an off-screen GrafPort to draw
into. I draw my bit images into this off-screen GrafPort and then use
copybits to copy from off-screen GrafPort to print GrafPort. My routine
works just fine (after much work). This is how I declare and load my
pointer to the off-screen port structure:
GrafPtr gNewPort;
gNewPort = (GrafPtr)NewPtr(sizeof(GrafPort));
This is how I declare and load my pointer to the print port structure:
TPPrPort printPort;
printPort = PrOpenDoc( gPrintRecordH, NIL_POINTER, NIL_POINTER);
And this is how I use CopyBits to copy from the off-screen GrafPort to
the print GrafPort:
CopyBits(&gNewPort->portBits,&thePort->portBits,
&srcRect,&destRect,srcCopy,0L);
The address of the destination BitMap (&thePort->portBits) is used because
at the time of the CopyBits invocation the print GrafPort is the current
active GrafPort.
To get a better understanding of how things work, I decided to try and
change the destination BitMap parameter to indicate the print GrafPort
directly (printPort) instead of 'thePort' (current active GrafPort). I
have tried by changing '&thePort->portBits' to the following:
&printPort->gPort.portBits (*)
printPort->gPort.portBits
&printPort->portBits
(GrafPtr)&printPort->gPort.portBits
I've probably tried many others as well. Nothing works and I don't
understand why! I thought for sure that the first one (*) above
would work. Will anything work or should I just stick with
'&thePort->portBits' ??? Thanks for any help/advice!
/steve greenfield <feats@vtvm1.cc.vt.edu>
Path: ucivax!gateway
From: dittmer@fokus.uke.uni-hamburg.de (Ulf Dittmer)
Subject: Beginners question
Message-ID: <9403101340.aa05490@q2.ics.uci.edu>
X-Vms-Cc: DITTMER
Newsgroups: fa.think-c
X-Message-ID: <9403102140.AA02554@fbihh.informatik.uni-hamburg.de>
Approved: usenet@q2.ics.uci.edu
X-Vms-To: SMTP%"think-c@ics.uci.edu"
Lines: 17
Date: 10 Mar 94 21:40:50 GMT
Dear THINKers,
I just start to work with Think C and to read this list so please
forgive if I am doing anything wrong.
I tried to compile a few old sources I got and they have lines like
#include <MenuMgr.h>
all over the place. The names of the Think Header files are slightly
different, e.g. Menus.h. I don't want to change all my files (I have
to use them with MPW also), so what can I do besides creating an
alias of MenuMgr.h named Menus.h ?
The manual mentions the MacHeaders file but I don't want to comment
out all the #include lines. Am I missing something obvious ?
Many thanks in advance for any help in this.
Greetings, Ulf
dittmer@uke.uni-hamburg.de
Path: ucivax!gateway
From: gurgle@netcom.com (Pete Gontier)
Subject: Re: Speaking of docviewer...
Message-ID: <9403101534.aa14552@q2.ics.uci.edu>
In-Reply-To: <199403102233.RAA19157@hobbes> from "Jason A. Bobier" at Mar 10, 94 05:33:54 pm
X-Mailer: ELM [version 2.4 PL23]
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset=US-ASCII
Content-Length: 407
MIME-Version: 1.0
Newsgroups: fa.think-c
X-Message-ID: <199403102335.PAA21014@netcom9.netcom.com>
Approved: usenet@q2.ics.uci.edu
Lines: 11
Date: 10 Mar 94 23:34:31 GMT
> > A few months ago I got the same tip and downloaded a MacTCP API
> > document. It's in DocViewer format, by the way. I was all excited to
>
> Speaking of DocViewer, does anyone know if there is a utility around to
> create DocViewer documents?
You can license it from Apple. It's expensive. Try email to
sw.license@applelink.apple.com.
--
Pete Gontier, CTO, Integer Poet Software; gurgle@netcom.com
Path: ucivax!gateway
From: walrathw@rferl.org (WalrathW)
Subject: RE: And now for something completely different
Message-ID: <9403102325.aa05428@q2.ics.uci.edu>
Content-transfer-encoding: 7BIT
Content-type: TEXT/PLAIN; CHARSET=US-ASCII
Newsgroups: fa.think-c
X-Message-ID: <01H9U85EUA2Q8WW6OX@MUVAXA.RFERL.ORG>
Approved: usenet@q2.ics.uci.edu
Lines: 50
Date: 11 Mar 94 07:25:29 GMT
> Initially, I was going to put the modeless dialog on screen in the
> beginning. So, my algo is something like this:
>
>
> DialogPtr gMyDialog; /* Global, defined somewhere else */
>
> gMyDialog = GetNewDialog(dialogID, NIL_POINTER, MOVE_TO_FRONT);
> ShowWindow(gMyDialog);
>
> and that is about it. Since I don't have any use for the dialog yet
> -- I
> just wanted to see it on the screen -- I did not bother about
> IsDialogEvent() and such. Well, when I run the code I have the dialog
> window on the screen but with none of its items (buttons, static text,
> PICT
> resource) visible. If I click on the dialog, the system crashes. If
> I
> open my window (that one I created in the previous chapter) AND THEN
> click
> on the dialog, nothing happens (no crashes). Suggestions?
I think the problem with it crashing is because you probably need to SetPort to
the dialog, since your code may be trying to handle your mouseDown event, but
without the port set properly. That I'm not certain about, but it sounds like
what's happening.
As for not seeing any of your DITL elements in the dialog, I would guess that's
because you aren't giving the Dialog Manager a single chance to update itself.
By not calling IsDialogEvent even a single time, there is an updateEvt for your
dialog not getting handled.
Mauricio, I have a suggestion to make. There is source code out on the nets
from the book "Macintosh Programming Secrets" (Knaster & Rollin), and it
contains several different mini-programs, all based on the same shell. One of
the apps contains code to handle three different kinds of dialogs: There is a
modal dialog with a dozen or more different items, a Movable Modal progress bar
(exactly like the Finder's copy dialog), and a modeless dialog with two popup
menus in it. Another one of the shells has support for multiple windows,
including zooming rectangles, and "Cleaning Up" the windows (resizing and
positioning them in some organized way). If you are struggling with some of
these basic toolbox elements, play around with the MPS shell (and pick up a
copy of the book next time you're in a bookstore) to see how it's done.
You can ftp the MPS sources from the umich archives, or one of the sumex
mirrors (since Sumex is probably still rebuilding). If you don't find it, I'll
send it to you.
cheers,
-wayne
Path: ucivax!gateway
From: dh@dapsun.lif.icnet.uk (Davis Holland)
Subject: Help with displaying the Apple Symbol.
Message-ID: <9403110531.aa02272@q2.ics.uci.edu>
Newsgroups: fa.think-c
X-Message-ID: <2lprhh$35a@nagos.lif.icnet.uk>
Approved: usenet@q2.ics.uci.edu
Organization: Imperial Cancer Research Fund
Lines: 10
Date: 11 Mar 94 13:31:15 GMT
I need some very elementary help with displaying
the Apple Symbol in Think C.
I know Pascal would use the CHR(AppleMark); command.
What is the equivalent in Think C?
Any offers?
Davis.
Path: ucivax!gateway
From: gurgle@netcom.com (Pete Gontier)
Subject: Re: Help with displaying the Apple Symbol.
Message-ID: <9403110925.aa14908@q2.ics.uci.edu>
X-Mailer: ELM [version 2.4 PL23]
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset=US-ASCII
Content-Length: 3255
MIME-Version: 1.0
Newsgroups: fa.think-c
X-Message-ID: <199403111725.JAA11000@mail.netcom.com>
Approved: usenet@q2.ics.uci.edu
Lines: 81
Date: 11 Mar 94 17:25:09 GMT
Davis:
It appears that your system is producing a bad return address for you.
This is the second time this has happened to me in attempting to send
you mail. Along with my answer, I am including the mail headers I got
back from my failed mail to you because (obviously) I can't send them to
you in mail. Note the message seems to indicate that your apparent host
(dapsun.lif.icnet.uk) exists but that it does not know who you (dh) are.
> From Mailer-Daemon Fri Mar 11 08:05:42 1994
> Date: Fri, 11 Mar 1994 08:05:42 -0800
> From: Mailer-Daemon (Mail Delivery Subsystem)
> Subject: Returned mail: User unknown
> Message-Id: <199403111605.IAA13524@netcom9.netcom.com>
> To: gurgle
>
> The original message was received at Fri, 11 Mar 1994 08:05:18 -0800
> from gurgle@localhost
>
> ----- The following addresses had delivery problems -----
> dh@dapsun.lif.icnet.uk (unrecoverable error)
>
> ----- Transcript of session follows -----
> ... while talking to dapsun.lif.icnet.uk.:
> >>> RCPT To:<dh@dapsun.lif.icnet.uk>
> <<< 550 <dh@dapsun.lif.icnet.uk>... User unknown
> 550 dh@dapsun.lif.icnet.uk... User unknown
>
> ----- Original message follows -----
> Return-Path: <gurgle>
> Received: from localhost by netcom9.netcom.com (8.6.4/SMI-4.1/Netcom)
> id IAA13522; Fri, 11 Mar 1994 08:05:18 -0800
> From: gurgle (Pete Gontier)
> Message-Id: <199403111605.IAA13522@netcom9.netcom.com>
> Subject: Re: Help with displaying the Apple Symbol.
> To: dh@dapsun.lif.icnet.uk (Davis Holland)
> Date: Fri, 11 Mar 1994 08:05:17 -0800 (PST)
> In-Reply-To: <9403110531.aa02272@q2.ics.uci.edu> from "Davis Holland" at Mar 11, 94 01:31:15 pm
> X-Mailer: ELM [version 2.4 PL23]
> MIME-Version: 1.0
> Content-Type: text/plain; charset=US-ASCII
> Content-Transfer-Encoding: 7bit
> Content-Length: 1379
>
> > I need some very elementary help with displaying the Apple Symbol in
> > Think C. I know Pascal would use the CHR(AppleMark); command. What is
> > the equivalent in Think C?
>
> C is weakly typed. That means that every integer constant less than
> 256 and greater than -1 can also be an unsigned character constant.
> (In fact, C is so weakly typed that any number type can be used as a
> character -- but C will quietly truncate the number if it is too big or
> too small.) Say you have a function prototype:
>
> void foo (unsigned char x);
>
> You can call this function in two ways which interest us:
>
> foo ('b'); foo (98);
>
> Both calls do exactly the same thing because 98 is the ASCII code for
> 'b'. What this means is you don't have to typecast the 98. (In Pascal,
> the CHR call is basically a typecast with more safety; I believe it
> won't allow you to pass a REAL, for example.)
>
> Since the standard Mac C header <Fonts.h> declares:
>
> enum { appleMark = 20 };
>
> ...you can just do:
>
> foo (appleMark);
>
> Note that in C, an 'enum' is just a fancy way to say CONST. (C also
> supports a 'const' keyword. A third way to do this would have been
> to '#define appleMark 20'.) People try to use 'enum's like Pascal
> enumerated types, but the compiler doesn't enforce anything. The
> situation is a little bit better in C++, but only a little.
--
Pete Gontier, CTO, Integer Poet Software; gurgle@netcom.com
Path: ucivax!gateway
From: chharris@u.washington.edu (The Only Cow)
Subject: GWorld Trouble....
X-Sender: chharris@stein2.u.washington.edu
Message-ID: <9403130854.aa27570@q2.ics.uci.edu>
Content-Type: TEXT/PLAIN; charset=US-ASCII
Mime-Version: 1.0
Newsgroups: fa.think-c
X-Message-ID: <Pine.3.89.9403130802.A18094-0100000@stein2.u.washington.edu>
Approved: usenet@q2.ics.uci.edu
Lines: 66
Date: 13 Mar 94 16:54:20 GMT
Thanks to all those who replied to my GWorld stuff.... It took me a
while to find some sort of entry-level code....
I've managed to create GWorld's that mainly do what I want, except I
can't creat enough of 'em.... Here's a little snippet....
#include <QDOffscreen.h>
Rect gShipRect, gOffscreenShipRect;
void SetupGWorlds( void )
{
GetGWorld( &gCurrPort, &gCurrDev );
// Setup Background
iErr = NewGWorld( &gBackground, 0, &screenSize, nil, nil, 0 );
if (!iErr) {
LockPixels ( gBackground->portPixMap );
SetGWorld ( gBackground, NULL );
FillRect( &screenSize, black );
UnlockPixels ( gBackground->portPixMap );
}
// Setup Ship
iErr = NewGWorld( &gShip, 0, &gOffscreenShipRect, nil, nil, 0 );
if (!iErr) {
LockPixels ( gShip->portPixMap );
SetGWorld ( gShip, NULL );
gShipPict = GetPicture( 128 );
DrawPicture( gShipPict, &gOffscreenShipRect );
UnlockPixels ( gShip->portPixMap );
}
// Setup Workspace
iErr = NewGWorld( &gWorkspace, 0, &screenSize, nil, nil, 0 );
if (!iErr) {
LockPixels ( gWorkspace->portPixMap );
SetGWorld ( gWorkspace, NULL );
EraseRect( &screenSize );
UnlockPixels ( gWorkspace->portPixMap );
}
SetGWorld ( gCurrPort, gCurrDev );
}
Everything works okay, until I try to create the gWorkspace GWorld. At
that point, it complains to me about an impropper bit depth, even though
the depth is the same as the other calls.... Any ideas?
Thanks.
-Chris
_____________________________________________________________________________
"You're only guarenteed one life in this | Chris Harris / RAMP Productions
world, so you may as well make the most of | chharris@u.washington.edu
it.... Have a nice day or I'll kill you." | Finger me for my PGP public key
Path: ucivax!gateway
From: bruno.besace@utopia.fnet.fr (Bruno Besace)
Subject: Documentation to developp external module for Wavicle 1.0
X-Sender: FBB@utopia.fnet.fr
Message-ID: <9403131112.aa01933@q2.ics.uci.edu>
Content-Type: text/plain; charset="us-ascii"
Mime-Version: 1.0
Newsgroups: fa.think-c
X-Message-ID: <199403131911.AA15935@indus.fnet.fr>
Approved: usenet@q2.ics.uci.edu
Lines: 17
Date: 13 Mar 94 19:12:23 GMT
I come to discover the software shareware Wavicle 1.0 of Lee Fyock.
It is a software of sound processing of open structure allows to develop
external processing modules.
I would be delighted that a developper could provide me information for
developper of external modules.
Thank you, in advance, the assistance that you will be to even to bring me.
--
Bruno Besace.
bruno.besace@fnet.fr
Path: ucivax!gateway
From: mike.nowak@aoce.itd.umich.edu (Mike Nowak)
Subject: Re: CopyBits (Off-Screen to Print)
Message-ID: <9403140558.aa00275@q2.ics.uci.edu>
Newsgroups: fa.think-c
X-Message-ID: <9403141356.AA08478@mailrus.cc.umich.edu>
Approved: usenet@q2.ics.uci.edu
Lines: 121
Date: 14 Mar 94 13:58:04 GMT
Steve, don't you also need to allocate memory for the bitmap you will be
copying into? Here's is a routine from an XCMD I wrote that draws an animated
sine wave. It creates an offscreen bitmap and draws the sine wave into it.
Then it copies bits form the offscreen bitmap onto the screen. The code is a
little old so I hope it's accurate:
void
SineWave(Rect *destRect, unsigned amplitude, unsigned wavelength, short
penwidth, RGBColor *color)
{
short width, height, extra, offset;
short x, y;
BitMap bitMap;
GrafPort grafPort, *oldPort, *newPort;
CGrafPort colorPort;
Rect srcRect;
CursHandle watch;
RGBColor oldColor;
watch = GetCursor(watchCursor);
if (watch != (CursHandle)0)
SetCursor(*watch);
width = destRect->right - destRect->left;
height = destRect->bottom - destRect->top;
/* We need a bit of extra wave to animate */
extra = wavelength;
GetPort(&oldPort); /* get the current grafport */
// Steve, here the bitmap is allocated.
bitMap.rowBytes = ((width + extra + 15) / 16) * 2;
SetRect(&bitMap.bounds, 0, 0, width + extra, height);
bitMap.baseAddr = NewPtrClear((long)(bitMap.rowBytes * height));
if (bitMap.baseAddr != 0L) {
OpenPort(&grafPort); /* create a new, temporary grafport */
SetPortBits(&bitMap); /* set the portBits to our bitmap */
BlockMove((Ptr) &bitMap.bounds, (Ptr) &grafPort.portRect, sizeof(Rect));
RectRgn(grafPort.visRgn, &bitMap.bounds);
SetPort(&grafPort); /* use our port */
/* Draw the sine wave */
PenSize(penwidth, penwidth);
MoveTo(0, height/2);
for (x = 0; x < width + extra; x++) {
y = (short)(amplitude * sin(x * (2.0 * PI)/wavelength));
LineTo(x, height/2 - y);
}
SetPort(oldPort); /* restore the old port before disposing our ours! */
ClosePort(&grafPort); /* so that the port memory is released */
/* Now animate until mouseClick */
if (HasColor()) {
GetForeColor(&oldColor);
/* If the port is color, then use it */
if ( ((CGrafPtr)oldPort)->portVersion & 0xc000 ) {
RGBForeColor(color);
newPort = oldPort;
}
/* Else, create a new color port */
else {
OpenCPort(&colorPort);
colorPort.portRect = oldPort->portRect;
(**(colorPort.portPixMap)).bounds = oldPort->portBits.bounds;
SetPort(&colorPort); /* use our port */
RGBForeColor(color);
newPort = (GrafPtr)&colorPort;
}
}
else
newPort = oldPort;
SetRect(&srcRect, 0, 0, width, height);
offset = 0;
InitCursor();
while (!Button()) {
srcRect.left = offset;
srcRect.right = srcRect.left + width;
CopyBits(&bitMap, &newPort->portBits, &srcRect, destRect, srcCopy, 0L);
offset = (offset + 1) % extra;
}
if (newPort != oldPort) {
SetPort(oldPort);
ClosePort(newPort);
}
if ( ((CGrafPtr)oldPort)->portVersion & 0xc000 )
RGBForeColor(&oldColor);
DisposPtr(bitMap.baseAddr); /* dispose of our off-screen bitmap memory */
}
else
SysBeep(10); /* Not enough memory */
}
------ From: Steve Greenfield, Thu, Mar 10, 1994 ------
I have written a routine which creates an off-screen GrafPort to draw
into. I draw my bit images into this off-screen GrafPort and then use
copybits to copy from off-screen GrafPort to print GrafPort. My routine
works just fine (after much work). This is how I declare and load my
pointer to the off-screen port structure:
GrafPtr gNewPort;
Path: ucivax!gateway
From: jaha@secrc.abb.se ("Jan R. M. Rohman")
Subject: memory allocation
Message-ID: <9403170142.aa00587@q2.ics.uci.edu>
Newsgroups: fa.think-c
X-Message-ID: <9403170933.AA07953@kbmhp1.secrc.abb.se>
Reply-To: jaha@secrc.abb.se
Approved: usenet@q2.ics.uci.edu
Lines: 19
Date: 17 Mar 94 09:42:38 GMT
Hi,
Im' writing a program for solving systems of linear equations.
In the code I want to use malloc() to allocate memory for the
matrices and vectors. My question is:
When I call malloc(), are the needed memory taken from the
application memory set from the dialog "Set Application Type..." in
Think C or outside this memory area?
----------------------------------------------------------------------
From: jaha@secrc.abb.se Jan R. M. Rohman !
Phone: +46 21 32 31 48 ABB Corporate Research Center Dept. KF !
Fax: +46 21 32 31 01 Department of Computational Methods, !
Electromagnetic Fields and Fluid Dynamics !
S-721 78 Vasteras, SWEDEN !
Home: Vasagatan 35, 722 15 Vasteras, Phone: +46 21 83 06 00 !
----------------------------------------------------------------------
Path: ucivax!gateway
From: vince_paragano@maca.sarnoff.com (Vince Paragano)
Subject: Talking to an ImageWriter d
Message-ID: <9403170634.aa23743@q2.ics.uci.edu>
Newsgroups: fa.think-c
X-Message-ID: <9403171433.AA01546@nova.sarnoff.com>
Approved: usenet@q2.ics.uci.edu
Lines: 21
Date: 17 Mar 94 14:34:18 GMT
Talking to an ImageWriter directly from_
Hi,
I'm trying to send raw bytes (printing chars and escape sequences) to an
ImageWriter printer from my Mac Classic (sys 6.0.7) using ThinkC. Used an
example from the on-line Think C Reference...
hooked-up an RS-232 break-out-box and see bytes flickering across to the
printer. However, the printer never prints anything. I've tried sending like
thousands of bytes so I know it's not the printer's buffer not being full.
What's going on? Ayone know how to do this or better yet have some sample code
to do it?! I don't want to use the printer driver as I might go with
non-quickdraw printers in the future in my application. Any help would be
greatly appreciated.
Thanks in advance,
-Vince
Vince Paragano
David Sarnoff Research Center
Princeton, NJ 08540
(609) 734-2580
Path: ucivax!gateway
From: mxmora@unix.sri.com (Matthew Xavier Mora)
Subject: Re: Talking to an ImageWriter d
Message-ID: <9403170941.aa06593@q2.ics.uci.edu>
Content-Type: text/plain; charset="us-ascii"
Mime-Version: 1.0
Newsgroups: fa.think-c
X-Message-ID: <9403171742.AB20971@unix.sri.com>
Approved: usenet@q2.ics.uci.edu
Lines: 29
Date: 17 Mar 94 17:41:46 GMT
> Talking to an ImageWriter directly from_
>Hi,
>I'm trying to send raw bytes (printing chars and escape sequences) to an
>ImageWriter printer from my Mac Classic (sys 6.0.7) using ThinkC. Used an
>example from the on-line Think C Reference...
>hooked-up an RS-232 break-out-box and see bytes flickering across to the
>printer. However, the printer never prints anything. I've tried sending like
>thousands of bytes so I know it's not the printer's buffer not being full.
>What's going on? Ayone know how to do this or better yet have some sample code
>to do it?! I don't want to use the printer driver as I might go with
>non-quickdraw printers in the future in my application. Any help would be
>greatly appreciated.
>Thanks in advance,
Try text streaming. Most printer drivers support a call that lets you send
ascii text to the printer.
Matt
__________________________________________________________________
Matthew Xavier Mora (cybernaut) The keeper of the UMPG
SRI International mxmora@unix.sri.com
[Sent using Eudora 2.0.2] Matt_Mora@QM.sri.com
"Thanks to Apple Computers, it's Bitchin what these things can
do." Tori Amos
__________________________________________________________________
Path: ucivax!gateway
From: crawford@scipp.ucsc.edu (Mike Crawford)
Subject: Re: memory allocation
Message-ID: <9403171101.aa17642@q2.ics.uci.edu>
In-Reply-To: <9403170142.aa00587@q2.ics.uci.edu>; from "Jan R. M. Rohman" at Mar 17, 94 9:42 am
X-Mailer: ELM [version 2.3 PL11]
Newsgroups: fa.think-c
X-Message-ID: <199403171903.AA19746@scipp.ucsc.edu>
Approved: usenet@q2.ics.uci.edu
Lines: 62
Date: 17 Mar 94 19:01:55 GMT
Jan Rohman writes,
> When I call malloc(), are the needed memory taken from the
> application memory set from the dialog "Set Application Type..." in
> Think C or outside this memory area?
Jan,
Presumably the reason that you are asking about this is that you have some
existing code that uses malloc(). With this assumption, let us avoid the
ansi-vs-mac flame war of a few months ago.
The malloc that is given in the Think C library gets its memory from the
application heap (as specified in Set Application Type). However, the malloc
that is provided is quite buggy and should not be used for any purpose more
serious than getting your code to compile.
The reason is that malloc allocates large blocks that are never, ever
freed (or not while your application is running). When you call free() to
free some malloc'ed memory, the memory is freed from malloc's tables but is
not returned to the Macintosh memory manager.
To deal with this, replace the ANSI library with your own. Start by adding
the C source files that are in the C Libraries:sources folder to your
application, and removing whatever ANSI library you presently use. Get it to
compile and run.
(I recommend doing this by adding one file at a time and checking the link.
You are likely to find that you can cut down on the library size quite a bit.)
Next, remove the source file that includes malloc, and replace it with one
like this. You will need to fix up the prototypes:
void *malloc( size_t theSize )
{
return NewPtr( theSize );
}
void free( void *thePtr )
{
DisposHandle( thePtr );
}
This will have the added benefit of allowing you to use the leaks dcmd in
Macsbug to find memory leaks quickly.
Accept the voice of hard experience: just say no to Think C's ANSI code.
If you must use it, write your own. Some undergrad who wants a good term
project ought to write one and upload it to ics.uci.edu.
BTW, the exit() call in Think C will cause any code resource to crash.
In particular, if you use stdio, and you exit by falling off the end of
main(), you will crash later on. This is because Think C patches the
ExitToShell trap to call a procedure that closes stdio files and runs any
tasks that have been scheduled by the atexit() call. If you use stdio from
a code resource, comment off the patch code in the Think C source (make
your own copy first, of course)
Mike Crawford | Author of the Word Services Apple Event Suite.
crawford@scipp.ucsc.edu | Free Mac Source Code: ftp sumex-aim.stanford.edu
| get /info-mac/dev/src/writeswell-jr-102-c.hqx
Path: ucivax!gateway
From: Lance.Helsten@m.cc.utah.edu (Lance Helsten)
Subject: Think C++ bug
Message-ID: <9403171547.aa16982@q2.ics.uci.edu>
Content-Type: TEXT/PLAIN; charset=US-ASCII
MIME-Version: 1.0
Newsgroups: fa.think-c
X-Message-ID: <Pine.3.07.9403171611.A18407-a100000@u.cc.utah.edu>
Approved: usenet@q2.ics.uci.edu
Lines: 35
Date: 17 Mar 94 23:47:01 GMT
Does anyone know Symantec tech support e-mail address?
Found a bug that is in the dusty corners of Think C++. If you are using
inline assembly code with a #pragma parameter it will corrupt data randomly.
e.g.
void myproc () {
jmp_buf theBuf;
if(setjmp(theBuf) == 0) {
//...
}
}
results in this code
//...
pea theBuf(a6) ;last myproc instruction
move.l #0,d0 ;first setjmp instruction
lea @1,a1
move.l d3-d7/a1-a4/a7,(a0) ;notice a0 can be anything
@1
//...
For some reason the #pragma parameter __D0 setjmp(__A0) is not working in
Think C++. So if you use any of these type of functions then add
Move.l (SP)+,A0 before the move.l in setjmp (each function will have to be
looked at individually).
I hope this helps.
Lance
Path: ucivax!gateway
From: blumenau@campanile.eecs.berkeley.edu ("Trevor I. Blumenau")
Subject: Examples wanted
Message-ID: <9403171808.aa25073@q2.ics.uci.edu>
Newsgroups: fa.think-c
X-Message-ID: <199403180208.SAA03784@campanile.eecs.berkeley.edu>
Approved: usenet@q2.ics.uci.edu
Lines: 14
Date: 18 Mar 94 02:08:19 GMT
I'm testing my translator and I need some example files. If you could,
please mail me one or all of the following types (containing any junk):
AIFF
AIFC
PICS
trak
sfil
moov (Is this different from a MooV?)
Your help is much appreciated.
Trevor
blumenau@eecs.berkeley.edu
Path: ucivax!gateway
From: pindar3@cix.compulink.co.uk (Pindar Infotek Ltd)
Subject: ANSI problems - is this the
Message-ID: <9403180302.aa24935@q2.ics.uci.edu>
Newsgroups: fa.think-c
Reply-To: pindar3@cix.compulink.co.uk
X-Message-ID: <memo.693501@cix.compulink.co.uk>
Approved: usenet@q2.ics.uci.edu
Lines: 29
Date: 18 Mar 94 11:02:50 GMT
From Pindar user Ian McCall
Subject: _ANSI problems - is this the same for MPW?
Hello.
I'm new to this newsgroup, so sorry if I'm covering old ground.
I've just read Mike Crawford's rather worrying message about THINK's
ANSI library. My question is this - does this affect MPW at all? I
regularly use both environments, and the symptoms described could
explain some problems our Technical department have run into using
calloc and malloc under MPW.
Finally, is there a F.A.Q. for this group so that I can avoid getting
flamed to death for asking questions listed there?
Thanks in advance for any information.
Cheers,
Ian
---
Please make 'Attn:<space>Ian McCall' the first line of your reply
(not the subject) to ensure automatic forwarding to the correct
Pindar user.
Path: ucivax!gateway
From: Brian.Bezanson@macsrv.mgi.com (Brian Bezanson)
Subject: RE>Re: memory allocation
Message-ID: <9403180918.aa07977@q2.ics.uci.edu>
X-Mailer: InterCon Dispatcher/SMTP for QuickMail
Newsgroups: fa.think-c
X-Message-ID: <199403181119244448@macsrv.mgi.com>
Approved: usenet@q2.ics.uci.edu
X-Priority: 4
Lines: 29
Date: 18 Mar 94 17:18:25 GMT
Date 3/18/94
Subject RE>Re- memory allocation
From Brian Bezanson
To think-c
Reply to: RE>Re: memory allocation
>void *malloc( size_t theSize )
>{
> return NewPtr( theSize );
>}
>
>void free( void *thePtr )
>{
> DisposHandle( thePtr );
>}
Oops, I think you meant to say DisposPtr not Handle-- A DisposHandle on a
NewPtr may cash potentially bad things to happen.
====
Brian R Bezanson Phone: +1 612 854 1220
Management Graphics, Inc. Fax: +1 612 851 6159
1401 E 79th Street internet: bezanson@mgi.com
Minneapolis, MN 55425 AppleLink: BEZANSON
Path: ucivax!gateway
From: aland@cs.brandeis.edu ("Alan D.")
Subject: Re: RE>Re: memory allocation
Message-ID: <9403181146.aa20872@q2.ics.uci.edu>
In-Reply-To: <9403180918.aa07977@q2.ics.uci.edu> from "Brian Bezanson" at Mar 18, 94 05:18:25 pm
X-Mailer: ELM [version 2.4 PL22]
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset=US-ASCII
Content-Length: 906
MIME-Version: 1.0
Newsgroups: fa.think-c
X-Message-ID: <199403181946.OAA13549@goose.cs.brandeis.edu>
Approved: usenet@q2.ics.uci.edu
Lines: 35
Date: 18 Mar 94 19:46:10 GMT
To quote Brian Bezanson,
> >void *malloc( size_t theSize )
> >{
> > return NewPtr( theSize );
> >}
> >void free( void *thePtr )
> >{
> > DisposHandle( thePtr );
> >}
> Oops, I think you meant to say DisposPtr not Handle-- A DisposHandle on a
> NewPtr may cash potentially bad things to happen.
I was going to reply to this, but I figured I'd wait & see if anyone
else did...
I think "free" should have been declared as:
void free(void *thePtr)
{
DisposePtr(*thePtr);
thePtr = NULL;
}
This does two things. First, it corrects what I think is a bug in the
code (calling DisposHandle on a pointer to a pointer. They are subtly
different), and second it sets thePtr to NULL so (assuming you check
for such things) you can't resuse the pointer 'accidentally'.
An even better (pun intended) value to set thePtr to is the one which
"EvenBetterBusError" sets memory location 0 to. :)
-=Alan
Path: ucivax!gateway
From: evans@natural.com (Christopher Evans)
Subject: Think Reference Easter Egg
X-Sender: cevans@cypress
Message-ID: <9403181208.aa22278@q2.ics.uci.edu>
Content-Type: text/plain; charset="us-ascii"
content-length: 734
Mime-Version: 1.0
Newsgroups: fa.think-c
X-Message-ID: <9403182008.AA27596@cypress.sybgate.sybase.com>
Approved: usenet@q2.ics.uci.edu
Lines: 20
Date: 18 Mar 94 20:08:26 GMT
Since Easter is coming up soon and since I haven't seen this until I was
looking for the word Rotate in Think Reference, I will share this with you:
type the following to Think reference, then hit return:
GetProcessSerialNumberFromPortName Tips
Make sure you include the space between Name and Tips.
If this is a WNF, sorry to waste your time.
<==================================Q==================================>
Christopher Evans | Internet: evans@natural.com
Director, Software Development | AOL: ChrisEvans
Natural Intelligence, Inc. | Sneakernet: 3rd cube on the right
2067 Massachusetts Ave. | Phone: (617) 876-4876
Cambridge, MA 02140 | Fax: (617) 492-7425
Path: ucivax!gateway
From: ccasey@conch.senod.uwf.edu (Christopher Casey)
Subject: printing part of a PICT
Message-ID: <9403181458.aa02398@q2.ics.uci.edu>
Newsgroups: fa.think-c
X-Message-ID: <9403182258.AA12139@conch.senod.uwf.edu>
Approved: usenet@q2.ics.uci.edu
Lines: 30
Date: 18 Mar 94 22:58:36 GMT
Hello everybody,
I seem to have a small problem.
I have a picture of this size:
PPPPPPPPPPPPPPPPPPPPPPPPPPP
P P
P P
PPPPPPPPPPPPPPPPPPPPPPPPPPP
and a printer of this size:
xxxx
x x
x x
xxxx
If I scale the picture to fit on the page I can't read the text.
Does anybody know how to print specific parts of a picture?
thanx much,
ccasey@scallop.senod.uwf.edu
chris casey.
Path: ucivax!gateway
From: gurgle@netcom.com (Pete Gontier)
Subject: Re: RE>Re: memory allocation
Message-ID: <9403181458.aa02439@q2.ics.uci.edu>
In-Reply-To: <9403181146.aa20872@q2.ics.uci.edu> from "Alan D." at Mar 18, 94 07:46:10 pm
X-Mailer: ELM [version 2.4 PL23]
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset=US-ASCII
Content-Length: 894
MIME-Version: 1.0
Newsgroups: fa.think-c
X-Message-ID: <199403182259.OAA16605@netcom9.netcom.com>
Approved: usenet@q2.ics.uci.edu
Lines: 34
Date: 18 Mar 94 22:58:49 GMT
> I think "free" should have been declared as:
>
> void free(void *thePtr)
> {
> DisposePtr(*thePtr);
> thePtr = NULL;
> }
>
> ...it sets thePtr to NULL so (assuming you check
> for such things) you can't resuse the pointer 'accidentally'.
You certainly can still use the pointer accidentally. If I write
void foo (char *s)
{
free (s);
}
...'s' still has the value passed into 'foo' because it gets passed to
'free' by value, not by reference. The line:
> thePtr = NULL;
...has basically no effect from the perspective of 'foo'.
> An even better (pun intended) value to set thePtr to is the one which
> "EvenBetterBusError" sets memory location 0 to. :)
That is a value tailored specifically to location 0. It may not be the
best value for pointers. Then again, it may. I use -1 because it's easy
to remember.
--
Pete Gontier, CTO, Integer Poet Software; gurgle@netcom.com
Path: ucivax!gateway
From: pchang@cs.stanford.edu (The Weasel)
Subject: Re: RE>Re: memory allocation
Message-ID: <9403181726.aa10641@q2.ics.uci.edu>
In-Reply-To: <9403181146.aa20872@q2.ics.uci.edu> from "Alan D." at Mar 18, 94 07:46:10 pm
X-Mailer: ELM [version 2.4 PL21]
Content-Type: text
Content-Length: 579
Newsgroups: fa.think-c
X-Message-ID: <9403190125.AA19859@Xenon.Stanford.EDU>
Approved: usenet@q2.ics.uci.edu
Lines: 23
Date: 19 Mar 94 01:26:04 GMT
You write :
> I think "free" should have been declared as:
>
> void free(void *thePtr)
> {
> DisposePtr(*thePtr);
> thePtr = NULL;
> }
This does not set the pointer that you pass in to NULL since the address
is still passed by value. For example:
char* binky = (char*)malloc(sizeof(char));
free(binky);
After the free call finishes binky will still have the same value that it
did before the free call, but now it will be pointing to unallocated space.
Peter
--
"The road of excess leads to the palace of wisdom."
William Blake
Path: ucivax!gateway
From: resnick@cogsci.uiuc.edu (Pete Resnick)
Subject: Re: RE>Re: memory allocation
X-Sender: resnick@tarski.cogsci.uiuc.edu
Message-ID: <9403181736.aa11075@q2.ics.uci.edu>
Content-Type: text/plain; charset="us-ascii"
Mime-Version: 1.0
Newsgroups: fa.think-c
X-Message-ID: <a9b0068900021003468d@[128.174.107.17]>
Approved: usenet@q2.ics.uci.edu
Lines: 38
Date: 19 Mar 94 01:36:33 GMT
At 7:46 PM 3/18/94 +0000, Alan D. wrote:
>I think "free" should have been declared as:
>
>void free(void *thePtr)
>{
> DisposePtr(*thePtr);
> thePtr = NULL;
>}
Not quite. If you really want to do this, you would have to:
void free(void **thePtr)
{
DisposePtr(*thePtr);
*thePtr = NULL;
}
Otherwise, you are setting the local variable "thePtr" to NULL, which is
not going to do a thing as far as reusing the pointer goes. What *you* want
to do is set the contents of the variable that contains the pointer to
NULL; in order to do that, you have to pass by reference.
But I would not recommend doing this anyway. Just because you set the
contents of one variable that contains this pointer to NULL, it doesn't
mean that you haven't copied that value to other variables, and all of
those would be invalid anyway.
Just write safe code.
pr
--
Pete Resnick (...so what is a mojo, and why would one be rising?)
Graduate assistant - Philosophy Department, Gregory Hall, UIUC
System manager - Cognitive Science Group, Beckman Institute, UIUC
Internet: resnick@cogsci.uiuc.edu
Path: ucivax!gateway
From: jonzy@cc.utah.edu (Rhett 'Jonzy' Jones)
Subject: RE: RE>Re: memory allocation
Message-ID: <9403191551.aa03797@q2.ics.uci.edu>
In-Reply-To: <9403181736.aa11075@q2.ics.uci.edu>
Content-Type: TEXT/PLAIN; charset=US-ASCII
MIME-Version: 1.0
Newsgroups: fa.think-c
X-Message-ID: <Pine.3.87.9403191635.B26768-0100000@soar.cc.utah.edu>
Approved: usenet@q2.ics.uci.edu
Lines: 34
Date: 19 Mar 94 23:51:16 GMT
Someone writes:
>I think "free" should have been declared as:
>
>void free(void *thePtr)
>{
> DisposePtr(*thePtr);
> thePtr = NULL;
>}
Someone else writes:
> void free(void **thePtr)
> {
> DisposePtr(*thePtr);
> *thePtr = NULL;
> }
Since when does the standard state free() makes any assignments?
If your modified free() routine ends up buried behind the sceens
in some library, debugging could be a pain in the hiney.
What is wrong with:
(void)free(thePtr);
thePtr = (PointerCast)NULL;
Just food for thought.
----------------------------------------------------------------
Rhett 'Jonzy' Jones | jonzy@cc.utah.edu
goPHerMaster | JONZY@UTAHCCA.BITNET
Gopher, PH, postmaster, ... | (801) 581-8810
----------------------------------------------------------------
Path: ucivax!gateway
From: stevenj@golf.sps.mot.com (Steven Jin)
Subject: Symantec C++ book
Message-ID: <9403211201.aa26839@q2.ics.uci.edu>
Newsgroups: fa.think-c
X-Message-ID: <9403211958.AA00835@golf.sps.mot.com>
Approved: usenet@q2.ics.uci.edu
Lines: 10
Date: 21 Mar 94 20:01:44 GMT
Has anyone read "Symantec C++ Macintosh programming guide"
by Symantec? Can you tell me how you liked the book?
I am thinking about buying the book but I like to get some
opinions from others first. Book costs about $40 I think.
Thank you,
Steven
Path: ucivax!gateway
From: harmonw@aol.com
Subject: The Internet and tcl archives
Message-ID: <9403211623.aa15352@q2.ics.uci.edu>
X-Mailer: America Online Mailer
Newsgroups: fa.think-c
X-Message-ID: <9403211921.tn204026@aol.com>
Approved: usenet@q2.ics.uci.edu
Lines: 8
Date: 22 Mar 94 00:23:35 GMT
What is happening on the internet with respect to Think C files? The ftp
sites mac.archive.umich.edu and wuarchive.wustl.edu no longer accept
anonymous ftp. They both stopped during this last month (Feb-Mar 1994). The
sumex info-mac at Stanford has been impossible to get into. Is Info-mac
archives dying???
I heard rumors of an info-mac CD-ROM coming out. Is this true? If so where
can it be ordered?
Path: ucivax!gateway
From: ASDVORAK@ccit.arizona.edu
Subject: SFGetFile()
Message-ID: <9403211723.aa19435@q2.ics.uci.edu>
Content-transfer-encoding: 7BIT
MIME-version: 1.0
Newsgroups: fa.think-c
X-Message-ID: <01HA8RUP1EQQ8WWUNH@CCIT.ARIZONA.EDU>
Approved: usenet@q2.ics.uci.edu
X-VMS-To: IN%"think-c@ics.uci.edu"
Lines: 37
Date: 22 Mar 94 01:23:15 GMT
X-Envelope-to: think-c@ics.uci.edu
I am have trouble using the procedure SFGetFile(). Whenever I run the
following code under the Think C Debugger it works fine, but when I try to run
it without the debugger my program quits without bringing up the Get File
dialog box. I took this fragment out of Think Ref so I assumed it would work.
Could someone please tell me what's going wrong? Thanks in advance (I'm
working on a IIci with Think C 6.01). Here's the code:
#include <Files.h>
#include <StandardFile.h>
main()
{
SFReply tr;
short rc, fRefNum;
Point where;
where.h=100; where.v=50;/* where the Standard File dialog window goes
*/
SFGetFile( where, "\pSelect a File", 0, -1, 0, 0, &tr );
if ( tr.good )
{
rc = FSOpen( tr.fName, tr.vRefNum, &fRefNum );
if ( rc )
{
SysBeep(20);
return;
}
FSClose( fRefNum );
}
}
Alexander
email: asdvorak@ccit.arizona.edu
Path: ucivax!gateway
From: monty@roscom.com (Monty Solomon)
Subject: Re: The Internet and tcl archives
Message-ID: <9403211748.aa20939@q2.ics.uci.edu>
Newsgroups: fa.think-c
X-Message-ID: <199403220126.AA21607@roscom.COM>
Approved: usenet@q2.ics.uci.edu
Lines: 16
Date: 22 Mar 94 01:48:04 GMT
> I heard rumors of an info-mac CD-ROM coming out. Is this true? If so where
> can it be ordered?
Info-Mac CD-ROM
Info-Mac II CD-ROM
Info-Mac III CD-ROM
$49.95 + $5 s/h
Pacific HiTech, Inc.
4530 Fortuna Way
Salt Lake City, UT 84124
801 278 2042
Fax 801 278 2666
Orders 800 765 8369
71175.3152@CompuServe.COM
Path: ucivax!gateway
From: mauricio@mozart.aero.ufl.edu (Mauricio Tavares)
Subject: Re: The Internet and tcl archives
Message-ID: <9403220607.aa03015@q2.ics.uci.edu>
In-Reply-To: <9403211623.aa15352@q2.ics.uci.edu>; from "harmonw@aol.com" at Mar 22, 94 12:23 am
X-Mailer: ELM [version 2.3 PL2]
Newsgroups: fa.think-c
X-Message-ID: <9403221407.AA07007@mozart.aero.ufl.edu>
Approved: usenet@q2.ics.uci.edu
Lines: 12
Date: 22 Mar 94 14:07:36 GMT
>
> What is happening on the internet with respect to Think C files? The ftp
> sites mac.archive.umich.edu and wuarchive.wustl.edu no longer accept
> anonymous ftp. They both stopped during this last month (Feb-Mar 1994). The
> sumex info-mac at Stanford has been impossible to get into. Is Info-mac
> archives dying???
>
Wuarchive is alive, but not as well as it used to. You can still
ftp to it, but the maximum number of people that can ftp at a given time
has been reduced. About archive.umich.edu, I can't say much about it since
I haven't visited it for quite a long time.
Path: ucivax!gateway
From: Brian.Bezanson@macsrv.mgi.com (Brian Bezanson)
Subject: RE>SFGetFile()
Message-ID: <9403220755.aa07783@q2.ics.uci.edu>
X-Mailer: InterCon Dispatcher/SMTP for QuickMail
Newsgroups: fa.think-c
X-Message-ID: <199403220956039689@macsrv.mgi.com>
Approved: usenet@q2.ics.uci.edu
X-Priority: 4
Lines: 70
Date: 22 Mar 94 15:55:14 GMT
Date 3/22/94
Subject RE>SFGetFile()
From Brian Bezanson
To ASDVORAK, think-c
Reply to: RE>SFGetFile()
> I am have trouble using the procedure SFGetFile(). Whenever I run the
>following code under the Think C Debugger it works fine, but when I try to
run
>it without the debugger my program quits without bringing up the Get File
>dialog box. I took this fragment out of Think Ref so I assumed it would work.
>Could someone please tell me what's going wrong? Thanks in advance (I'm
>working on a IIci with Think C 6.01). Here's the code:
>
>#include <Files.h>
>#include <StandardFile.h>
>
>main()
>{
> SFReply tr;
> short rc, fRefNum;
> Point where;
>
> where.h=100; where.v=50;/* where the Standard File dialog window goes
>*/
>
> SFGetFile( where, "\pSelect a File", 0, -1, 0, 0, &tr );
.. no more needed ..
You need to initialize the Mac toolbox managers. You got lucky in the Debugger
because it had initialized the Mac environment, when created as a real
application you're on your own.
Do something like this (taken from the THINK example bullseye.c)
/****
* InitMacintosh()
*
* Initialize all the managers & memory
*
****/
void InitMacintosh(void)
{
MaxApplZone();
InitGraf(&thePort);
InitFonts();
FlushEvents(everyEvent, 0);
InitWindows();
InitMenus();
TEInit();
InitDialogs(0L);
InitCursor();
}
====
Brian R Bezanson Phone: +1 612 854 1220
Management Graphics, Inc. Fax: +1 612 851 6159
1401 E 79th Street internet: bezanson@mgi.com
Minneapolis, MN 55425 AppleLink: BEZANSON
Path: ucivax!gateway
From: reardon@maroon.tc.umn.edu (Rich Reardon)
Subject: Disk drive code
Message-ID: <9403221105.aa19230@q2.ics.uci.edu>
Newsgroups: fa.think-c
Reply-To: Rich Reardon <reardon@maroon.tc.umn.edu>
X-Message-ID: <9403221105.aa19230@q2.ics.uci.edu>
Approved: usenet@q2.ics.uci.edu
Lines: 18
Date: 22 Mar 94 19:05:29 GMT
I am a novice C, and Think C, programmer. I would like to write an xcmd for
Hypercard that polls a Mac's floppy drive, and if it finds a Mac disk, returns
the volume name of the floppy.
Could someone point me to code that may exist, or to the toolbox calls I would
need to write the code? (I know how to create the xcmd part once I have the
code).
Thanks.
Rich Reardon
University Media Resources
540 Rarig Center
330 21st Ave South
Minneapolis, MN 55455
612-625-3486
fax: 612-624-6079
reardon@maroon.tc.umn.edu
Path: ucivax!gateway
From: rpa@netcom.com (Ramin Firoozye)
Subject: Re:Info-Mac CD-ROM
Message-ID: <9403221222.aa25004@q2.ics.uci.edu>
In-Reply-To: <9403211623.aa15352@q2.ics.uci.edu> from "harmonw@aol.com" at Mar 22, 94 00:23:35 am
X-Mailer: ELM [version 2.4 PL23]
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset=US-ASCII
Content-Length: 396
MIME-Version: 1.0
Newsgroups: fa.think-c
X-Message-ID: <199403222023.MAA24975@mail.netcom.com>
Approved: usenet@q2.ics.uci.edu
Lines: 14
Date: 22 Mar 94 20:22:55 GMT
>
> I heard rumors of an info-mac CD-ROM coming out. Is this true? If so where
> can it be ordered?
>
I was under the impression there already was one out there. Have you tried
Walnut Creek CD-ROM at (800) 786-9907. I though I saw one advertised by
someone (possibly them) at Comdex.
R.
--
Ramin Firoozye'
rp&A Inc. - San Francisco, California
Internet: rpa@netcom.COM - CIS: 70751,252
--
Path: ucivax!gateway
From: ccasey@conch.senod.uwf.edu (Christopher Casey)
Subject: saving pictures
Message-ID: <9403221429.aa03282@q2.ics.uci.edu>
Newsgroups: fa.think-c
X-Message-ID: <9403222228.AA19500@conch.senod.uwf.edu>
Approved: usenet@q2.ics.uci.edu
Lines: 10
Date: 22 Mar 94 22:29:25 GMT
Hello again,
I know I've asked this before, but does anyone know any good books that have code demonstrating how to save a picture?
I can't seem to figure it out from Inside Mac.
thanx,
chris casey
ccasey@triton.senod.uwf.edu
Path: ucivax!gateway
From: gurgle@netcom.com (Pete Gontier)
Subject: Re: saving pictures
Message-ID: <9403222137.aa25199@q2.ics.uci.edu>
In-Reply-To: <9403221429.aa03282@q2.ics.uci.edu> from "Christopher Casey" at Mar 22, 94 10:29:25 pm
X-Mailer: ELM [version 2.4 PL23]
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset=US-ASCII
Content-Length: 1342
MIME-Version: 1.0
Newsgroups: fa.think-c
X-Message-ID: <199403230537.VAA06144@netcom9.netcom.com>
Approved: usenet@q2.ics.uci.edu
Lines: 28
Date: 23 Mar 94 05:37:09 GMT
> ...does anyone know any good books that have code demonstrating how to
> save a picture? I can't seem to figure it out from Inside Mac.
Inside Mac won't help you at all. It used to be that there were Apple
Developer Technical Support Notes describing some of the simple graphics
file formats (MacPaint, PICT), but as those formats got spun off along
with the products which read and wrote them, Apple withdrew the Tech
Notes and replaced them with pointers to asking the relevant companies.
I'm not sure if Claris even ships a MacPaint or MacDraw any more --
anybody know?
Anyway, you have two ways to go:
(1) Do your drawing into a PicHandle and save it as a PICT resource.
AddResource, WriteResource, end of story.
(2) Do your drawing whatever way you want and dig up the relevant
documentation from the relevant vendor. Some people on this
list might even be able to provide a description of some of
the simpler file formats in just a few lines of text. For
example (this may or may not be valid -- my memory is fuzzy):
for PICT, write 512 bytes of 0, then write out a PicHandle.
The first 512 bytes used to be meaningful, but nobody pays
attention any more, and programs that care will be happy with 0.
--
Pete Gontier, CTO, Integer Poet Software; gurgle@netcom.com
Path: ucivax!gateway
From: inei@dcs.gla.ac.uk (inei)
Subject: Where can I get MetroWerks CodeWarrior
Message-ID: <9403230525.aa26121@q2.ics.uci.edu>
Newsgroups: fa.think-c
X-Message-ID: <9403231325.AA17720@hawaii.dcs.gla.ac.uk>
Approved: usenet@q2.ics.uci.edu
Lines: 14
Date: 23 Mar 94 13:25:46 GMT
Does anyone know where I can get a native compiler for the Power Mac
called MetroWerks CodeWarrior? A name, telephone number and address
would be greatly appreciated.
I've been told it may be available from APDA. Can anyone send me
details of how I can get it from APDA?
Many thanks in advance.
Mail: Nick Nei, Computing Science Dept.,
Glasgow Univ., 17 Lilybank Gardens,
Glasgow G12 8QQ, UK. Tel: (041) 339 8855 x 5457
ARPA: inei%uk.ac.glasgow.dcs@nsfnet-relay.ac.uk USENET: inei@cs.glasgow.uucp
Path: ucivax!gateway
From: lukas@iso.wwz.unibas.ch
Subject: Re: Where can I get MetroWerks CodeWarrior
Message-ID: <9403230849.aa04663@q2.ics.uci.edu>
In-Reply-To: Your message of "23 Mar 94 13:25:46 GMT." <9403230525.aa26121@q2.ics.uci.edu>
Newsgroups: fa.think-c
X-Message-ID: <9403231648.AA08213@iso.wwz.unibas.ch>
Approved: usenet@q2.ics.uci.edu
Lines: 19
X-Mts: smtp
Date: 23 Mar 94 16:49:04 GMT
You can get informations from MetroWerks with the following addresses
MetroWerks Inc.
The Trimex Building, Route 11
Mooers, NY 12958, USA
Tel. (514) 747-5999
Fax. (514) 747-2822
applelink d2734
internet metro@info.uqam.ca
If you buy the CodeWarrior and you think that this might be an alternative, especially the class library, to use on the mac please send me an e-mail
Path: ucivax!gateway
From: andyb+@cmu.edu ("Andrew J. Breen")
Subject: Timing Functions
Message-ID: <9403231236.aa18202@q2.ics.uci.edu>
Newsgroups: fa.think-c
X-Message-ID: <MhY_PMG00iV407Smh9@andrew.cmu.edu>
Approved: usenet@q2.ics.uci.edu
Lines: 11
Date: 23 Mar 94 20:36:40 GMT
I need some help in implementing some timing functions. I need to time
the length of insertion into an array. I have been trying to use the
time.h stuff, and saving the time into a variable before the array, and
after. I am just getting, what seems like, erroneous values into these
variables. I have been trying to use time_t. Any hints as to how to
implement using time.h, interpreting the return values, or another
timing method.
Andy
The graduation countdown has begun.
Path: ucivax!gateway
From: abarne1@gl.umbc.edu (barnett aaron)
Subject: terminal emulation
Message-ID: <9403231250.aa19022@q2.ics.uci.edu>
Newsgroups: fa.think-c
X-Message-ID: <199403232049.PAA10164@umbc9.umbc.edu>
Approved: usenet@q2.ics.uci.edu
Lines: 6
Date: 23 Mar 94 20:50:04 GMT
where can i get info on escape sequences for vt100/200...
specifically does anyone know the sequences for programming function keys?
.
aaron <abarne1@gl.umbc.edu>
"It's a safety mechanism, the mind shuts off."
Path: ucivax!gateway
From: ASDVORAK@ccit.arizona.edu
Subject: Another question...
Message-ID: <9403231837.aa13095@q2.ics.uci.edu>
Content-transfer-encoding: 7BIT
MIME-version: 1.0
Newsgroups: fa.think-c
X-Message-ID: <01HABMZG5PWY8WXYTO@CCIT.ARIZONA.EDU>
Approved: usenet@q2.ics.uci.edu
X-VMS-To: IN%"think-c@ics.UCI.EDU"
Lines: 21
Date: 24 Mar 94 02:37:45 GMT
X-Envelope-to: think-c@ics.UCI.EDU
Thank you for all your replies to SFGetFile(). Sorry for asking what
turned out to be a silly question. The function SFGetFile() in my code sample
didn't work because I somehow overlooked puting in my InitToolBox() procedure.
By putting it in, my code works fine.
Here's another question:
Many of the ToolBox routines accept pointers to data structures. For
example, SetRect takes a pointer to a Rect, NewWindow takes a pointer to a Rect
as well as a pointer to a long (RefCon), etc. It seems to me that this allows
these procedures (or functions), in effect, to return more variables then would
normally be allowed while avoiding the use of global variables. What exactly
goes on when SetRect modifies the data structure assigned to r in:
SetRect(&r,10,10,100,100)? Can I use this technique in functions that I
design? I often would like to return several different variables from a
function and would like to avoid the mess of creating a data structure to hold
them all and returning a pointer to such a data structure. Thank you in
advance for your help.
Alexander Dvorak
email: asdvorak@ccit.arizona.edu
Path: ucivax!gateway
From: askwersk@mit.edu
Subject: TCL Archives
Message-ID: <9403232001.aa16170@q2.ics.uci.edu>
Newsgroups: fa.think-c
X-Message-ID: <9403240401.AA20711@al-forno.MIT.EDU>
Approved: usenet@q2.ics.uci.edu
Lines: 5
Date: 24 Mar 94 04:01:40 GMT
To those who were looking for the TCL-TALK archives, they have been
moved to daemon.ncsa.edu. FTP there to find them in the TCL directory.
Adam Skwersky
Path: ucivax!gateway
From: askwersk@mit.edu
Subject: TCL TALK Archives.
Message-ID: <9403232007.aa16415@q2.ics.uci.edu>
Newsgroups: fa.think-c
X-Message-ID: <9403240407.AA20796@al-forno.MIT.EDU>
Approved: usenet@q2.ics.uci.edu
Lines: 10
Date: 24 Mar 94 04:07:26 GMT
IN my last message I said the TCL-TALK archive was moved to daemon.ncsa.edu.
MY MISTAKE! It was really moved to daemon.ncsa.uiuc.edu.
Sorry,
Adam Skwersky
Path: ucivax!gateway
From: roderis@csos.orst.edu ("Stephen C. Roderick")
Subject: Re: Timing Functions
Message-ID: <9403232044.aa17733@q2.ics.uci.edu>
In-Reply-To: <9403231236.aa18202@q2.ics.uci.edu>
Content-Type: TEXT/PLAIN; charset=US-ASCII
MIME-Version: 1.0
Newsgroups: fa.think-c
X-Message-ID: <Pine.3.88.9403232015.A22732-0100000@CSOS.ORST.EDU>
Approved: usenet@q2.ics.uci.edu
Lines: 41
Date: 24 Mar 94 04:44:51 GMT
On 23 Mar 1994, Andrew J. Breen wrote:
> I need some help in implementing some timing functions. I need to time
> the length of insertion into an array. I have been trying to use the
> time.h stuff, and saving the time into a variable before the array, and
> after. I am just getting, what seems like, erroneous values into these
> variables. I have been trying to use time_t. Any hints as to how to
> implement using time.h, interpreting the return values, or another
> timing method.
>
> Andy
>
> The graduation countdown has begun.
>
#include <time.h>
void TimeThis(void)
{
clock_t codeTime;
codeTime = clock();
// code that you are timing goes here
codeTime = clock() - codeTime;
printf("Total time taken = %d ticks (%d seconds)\n", codeTime,
codeTime/CLOCKS_PER_SEC);
}
Hasta,
Steve
-----------------------------------------------------------
Stephen Roderick
roderis@kira.csos.orst.edu
-----------------------------------------------------------
Path: ucivax!gateway
From: JeffC@cc.snow.edu ("Jeffrey K. Carney")
Subject: Launching from Doc
Message-ID: <9403251247.aa09611@q2.ics.uci.edu>
Content-Type: text/plain; charset="us-ascii"
Mime-Version: 1.0
Newsgroups: fa.think-c
X-Message-ID: <9403251246.aa09611@q2.ics.uci.edu>
Approved: usenet@q2.ics.uci.edu
Lines: 27
Date: 25 Mar 94 20:47:07 GMT
If someone would be so kind:
I want to simulate what happens when you double-click on a document to open
an application. That is, from inside my app, given a filespec to a
document (actually a settings file) and one to a daughter application, I
want to launch the daughter application using the settings described in the
document. My guess is that I do it this way:
Launch the app
send the app an OpenDocument apple event
the apple event names the document
Am I on target?
In any case, could some kind soul flesh this out in a little more detail?
I have no significant experience with apple events so far, and would
appreciate a little babying.
TIA
+===================+=================================+===================+
| Jeff Carney | | Snow College |
| jeffc@cc.snow.edu | | Ephraim, UT 84627 |
|-------------------+---------------------------------+-------------------|
|Plato: "Everything that deceives appears to cast a spell upon the mind."|
+=========================================================================+
Path: ucivax!gateway
From: evans@natural.com (Christopher Evans)
Subject: Re: Launching from Doc
X-Sender: cevans@cypress
Message-ID: <9403280547.aa24019@q2.ics.uci.edu>
Content-Type: text/plain; charset="us-ascii"
content-length: 1234
Mime-Version: 1.0
Newsgroups: fa.think-c
X-Message-ID: <9403281347.AB01836@cypress.sybgate.sybase.com>
Approved: usenet@q2.ics.uci.edu
Lines: 30
Date: 28 Mar 94 13:47:36 GMT
>If someone would be so kind:
>
>I want to simulate what happens when you double-click on a document to open
>an application. That is, from inside my app, given a filespec to a
>document (actually a settings file) and one to a daughter application, I
>want to launch the daughter application using the settings described in the
>document. My guess is that I do it this way:
>
>Launch the app
>send the app an OpenDocument apple event
>the apple event names the document
>
>Am I on target?
>In any case, could some kind soul flesh this out in a little more detail?
>I have no significant experience with apple events so far, and would
>appreciate a little babying.
Close but doing this will result in both a oapp and odoc event being sent
to the application. Check out the LaunchApplication routine. It lets you
send a list of aliases to open.
<==================================Q==================================>
Christopher Evans | Internet: evans@natural.com
Director, Software Development | AOL: ChrisEvans
Natural Intelligence, Inc. | Sneakernet: 3rd cube on the right
2067 Massachusetts Ave. | Phone: (617) 876-4876
Cambridge, MA 02140 | Fax: (617) 492-7425
Path: ucivax!gateway
From: jaha@secrc.abb.se ("Jan R. M. Rohman")
Subject: Strange Error
Message-ID: <9403282343.aa11136@q2.ics.uci.edu>
Newsgroups: fa.think-c
X-Message-ID: <9403290650.AA11840@kbmhp1.secrc.abb.se>
Reply-To: jaha@secrc.abb.se
Approved: usenet@q2.ics.uci.edu
Lines: 27
Date: 29 Mar 94 07:43:06 GMT
I'm developing a program in Think C 5.0.4 on an LC-475 and the
application seems to run perfectly. But, when I run the application,
both the builded and through the compiler with the debugger on, it
craches on a Mac IIx at the line:
menuBar = GetNewMBar(rMenuBar);
The error message says: bad address. When I singlestep the code in
the debugger I have to restart the Mac IIx after entering the line
above.
How can I find such an error. The program also run nicely on a Mac
IIci.
I'm greatful for all kind of help to solve this problem.
- Jan
----------------------------------------------------------------------
From: jaha@secrc.abb.se Jan R. M. Rohman !
Phone: +46 21 32 31 48 ABB Corporate Research Center Dept. KF !
Fax: +46 21 32 31 01 Department of Computational Methods, !
Electromagnetic Fields and Fluid Dynamics !
S-721 78 Vasteras, SWEDEN !
Home: Vasagatan 35, 722 15 Vasteras, Phone: +46 21 83 06 00 !
----------------------------------------------------------------------
Path: ucivax!gateway
From: idowell@bbn.com
Subject: Line Width and Position
Message-ID: <9403290701.aa08707@q2.ics.uci.edu>
Newsgroups: fa.think-c
X-Message-ID: <9403290701.aa08707@q2.ics.uci.edu>
Approved: usenet@q2.ics.uci.edu
Lines: 14
Date: 29 Mar 94 15:01:49 GMT
Let's say I'm drawing a line on a graph using LineTo.
If the PenSize is (1,1) everything is fine, x=y passes
through the origin. If I increase the PenSize to (8,8)
then only _one edge_ (not the center) of the line passes
through the origin. Is there a way to specify where the
extra width goes (a la Photoshop)? Or do I manually have
to calculate an offset?
Thanks!
Ian
------------------------------------------------------------------------
Ian Dowell Bolt, Beranek & Newman, Cambridge, MA
idowell@bbn.com (617) 873-2673
Path: ucivax!gateway
From: canna@bga.com (Canna Software Development)
Subject: Forcing a window to be on top of all windows
Message-ID: <9403290725.aa09740@q2.ics.uci.edu>
X-Mailer: ELM [version 2.4 PL23]
Content-Type: text
Content-Length: 661
Newsgroups: fa.think-c
X-Message-ID: <199403291525.AA25809@zoom.bga.com>
Approved: usenet@q2.ics.uci.edu
Lines: 14
Date: 29 Mar 94 15:25:27 GMT
I have a client who is interested in having a tool palette on top of an
already existing application (read a commercial application). Their
requirement is that the tool palette be visible at all times - otherwise
I would use the tool palette that is available in QuicKeys. Any suggestions?
Lloyd
----------------------------+------------------------------------
Lloyd Sargent | "Podia est gamia" - Sherlock Holmes
President | Internet: canna@bga.com
Canna Software Development | AOL: lgsargent@aol.com
/ this space \| Phone: (512) 243-0283
\ intentionally left blank /| Fax: (512) 243-0283
Path: ucivax!gateway
From: canna@bga.com (Canna Software Development)
Subject: SourceServer won't give me back my files!
Message-ID: <9403290739.aa10224@q2.ics.uci.edu>
X-Mailer: ELM [version 2.4 PL23]
Content-Type: text
Content-Length: 1589
Newsgroups: fa.think-c
X-Message-ID: <199403291539.AA26231@zoom.bga.com>
Approved: usenet@q2.ics.uci.edu
Lines: 39
Date: 29 Mar 94 15:39:22 GMT
Actually, I am having several problems with SourceServer at the moment.
If anyone can solve my problems, I will be eternally (or at least for the
next week) in your debt!
1) I open a project, start SourceServer, open the database, attempt to
check out my file and get the following:
### NameRevisions - The "-u" option requires a parameter.
# Usage - NameRevisions [-u User] [-project Project] [-public | -private
| -b] [-r]
[[-only] | name [[-expand] [-s] | [-replace] [-dynamic]
[namesI | -a]]]
Well, my first reaction was "THAT IS NOT WHAT I TOLD YOU TO DO!". My
second was, why in the heck is it doing this?
I had had it working fine, BUT one thing has transpired since I last used
SourceServer -- I installed System 7 Pro. Could it be upset that I
haven't got the networking stuff set up right (names and what not?).
2) Supposedly you can access SourceServer using an emply file in the
editor, selecting the command and type <control><return>. Well, it does
nothing when I do that. Zip. Could it have something to do with the
previous problem?
Thanks in advance for all who are able to give me advice!
Lloyd
P.S. Where are some good documents for writing code for MacTCP? Examples
would also be nice!
----------------------------+------------------------------------
Lloyd Sargent | "Podia est gamia" - Sherlock Holmes
President | Internet: canna@bga.com
Canna Software Development | AOL: lgsargent@aol.com
/ this space \| Phone: (512) 243-0283
\ intentionally left blank /| Fax: (512) 243-0283
Path: ucivax!gateway
From: nagel@ics.uci.edu (Mark Nagel)
Subject: ADMIN: List Disruption This Weekend
Message-ID: <9403291141.aa24859@q2.ics.uci.edu>
Newsgroups: fa.think-c
Reply-To: nagel@ics.uci.edu
X-Message-ID: <24855.764970083@ics.uci.edu>
Approved: usenet@q2.ics.uci.edu
Lines: 6
Date: 29 Mar 94 19:41:34 GMT
Apparently the entire campus of UC Irvine will be undergoing a power
outage from this Friday evening (4/1) through the following Monday
morning (4/4). During this time the mailing list and archives will
be inaccessible.
Mark "very grateful for not living on campus any longer"
Path: ucivax!gateway
From: eldred@rrunner.jpl.nasa.gov (Dan Eldred)
Subject: Find under project manager
Message-ID: <9403291144.aa25029@q2.ics.uci.edu>
Newsgroups: fa.think-c
X-Message-ID: <9403291944.AA01761@rrunner.jpl.nasa.gov>
Approved: usenet@q2.ics.uci.edu
Lines: 11
Date: 29 Mar 94 19:44:24 GMT
The multi-file search option under find will search through
all the include files if they are #included from the C programs
which are in the current project. But if an include file
#includes another include file, then the second include file
is not searched.
Any way around this? I'm having to use a standalone port
of egrep right now?
- Dan Eldred eldred@rrunner.jpl.nasa.gov
Path: ucivax!gateway
From: de19@umail.umd.edu (Dana S Emery)
Subject: Re: Line Width and Position
Message-ID: <9403291759.aa15994@q2.ics.uci.edu>
In-Reply-To: Your message <9403290701.aa08707@q2.ics.uci.edu> of 29 Mar 94
15:01:49 GMT
Content-Type: TEXT/plain; charset=US-ASCII
Newsgroups: fa.think-c
X-Message-ID: <Mailstrom.1.03.18202.9528.de19@umail.umd.edu>
Approved: usenet@q2.ics.uci.edu
Lines: 23
Date: 30 Mar 94 01:59:23 GMT
> If I increase the PenSize to (8,8) then only _one edge_
> (not the center) of the line passes through the origin.
That is due to the design of the QD imaging system, which is
discussed in IM:1 (qv), lord only knows what volume of the NIM
series covers it, perhaps in the overview volume or in the
long awaited (recently ?released) Imaging:QD volume.
The essence of it is: the pen dangles down and to the right
of its top-left corner, which is the locus of the current point.
Other imaging systems do it differently, notably Postscript.
In PS, a path has no width while it is being created, only when
it is stroked does the pen width come into use, at which time
the path defines the center of the pen, thus half of the pen
slops over onto each side of the path coloring pixels as it goes.
Thus, to convert locations from a QD framework to a PS one you must
consider line direction and width, so that an appropriate fraction
of the pen width can be added/subtracted to x and/or y.
--
dana s emery <de19@umail.umd.edu>
Path: ucivax!gateway
From: canna@bga.com (Canna Software Development)
Subject: Windows on top of all other windows...
Message-ID: <9403300917.aa05312@q2.ics.uci.edu>
X-Mailer: ELM [version 2.4 PL23]
Content-Type: text
Content-Length: 1870
Newsgroups: fa.think-c
X-Message-ID: <199403301716.AA29520@zoom.bga.com>
Approved: usenet@q2.ics.uci.edu
Lines: 39
Date: 30 Mar 94 17:17:32 GMT
>Write a desk accessory and stash it inside the application resource
>fork. To see if this wll be satisfactory, pick any small DA as an
>experimental test subject, install it into the app with Font/DA Mover
>(hold the option key down when clicking the "open" button), and show it
>to the client.
>
> Pete Gontier, CTO, Integer Poet Software; gurgle@netcom.com
Couple of problems with this solution:
1) Client (and myself) are running System 7 Pro, so I had to hunt up an
old copy of Font/DA Mover (which wouldn't run - so I changed the creator
in order to 'fool' System 7 Pro). I was lucky I hadn't pitched the 6.0.x
disks.
2) Using both an old DA of Puzzle (as well as the System 7 Pro), I got
a window (the puzzle), but it did NOT stay on top of the application's
windows.
3) The DA showed up in the Apple Menu list. I hate to think what
would/could happen if it was selected (probably nothing disasterous, most
likely it would 'select' the window (the one that should have stayed on TOP).
This was an interesting idea and the results were interesting, but it
does little to solve my clients needs. Thanks for the input, though.
So, the problem still remains. Is there a method to keep a window on top
of all other windows? Windows 3.1 has the capability (do NOT interpret
this as the start of a flame war - I only want to solve my client's
problem and am well aware of the strengths/weaknesses of PC vs. Mac),
surely it is possible to do it on the Mac!
Thanks again in advance,
Lloyd
----------------------------+------------------------------------
Lloyd Sargent | "Podia est gamia" - Sherlock Holmes
President | Internet: canna@bga.com
Canna Software Development | AOL: lgsargent@aol.com
/ this space \| Phone: (512) 243-0283
\ intentionally left blank /| Fax: (512) 243-0283
Path: ucivax!gateway
From: chrism@corp.cirrus.com (Chris Metcalfe)
Subject: Re: Windows on top of all other windows...
Message-ID: <9403301037.aa11350@q2.ics.uci.edu>
Newsgroups: fa.think-c
X-Message-ID: <9403301837.AA19423@tango.corp.cirrus.com>
Approved: usenet@q2.ics.uci.edu
Lines: 8
Date: 30 Mar 94 18:37:53 GMT
The Text Manager of System 7 has a utility window "layer"
that stays in front of all other windows. This was meant to
be used for multiple language environments, where you are typing
in a little bit of Japanese for insertion into an English
document, etc. It's covered in the new Inside Macintosh, "Text."
-- Chris Metcalfe
Path: ucivax!gateway
From: pindar3@cix.compulink.co.uk (Pindar Infotek Ltd)
Subject: Windows on top - Ghostwindo
Message-ID: <9403310352.aa01739@q2.ics.uci.edu>
Newsgroups: fa.think-c
Reply-To: pindar3@cix.compulink.co.uk
X-Message-ID: <memo.780537@cix.compulink.co.uk>
Approved: usenet@q2.ics.uci.edu
Lines: 22
Date: 31 Mar 94 11:52:18 GMT
From Pindar user Ian McCall
Subject: _Windows on top - Ghostwindow
I've never used this myself, but if you set the low memory global
GhostWindow to point to your window, you should guarantee that no
other window goes above yours. I think the way to hide it is to
CloseWindow following an app4/osEvt.
As I say, I've never done this myself. Maybe if someone has they
could post and give more accurate information?
Cheers,
Ian
---
Please make 'Attn:<space>Ian McCall' the first line of your reply
(not the subject) to ensure automatic forwarding to the correct
Pindar user.
Path: ucivax!gateway
From: inei@dcs.gla.ac.uk (inei)
Subject: Whereis Movies.h
Message-ID: <9403310633.aa20003@q2.ics.uci.edu>
Newsgroups: fa.think-c
X-Message-ID: <9403311432.AA25612@hawaii.dcs.gla.ac.uk>
Approved: usenet@q2.ics.uci.edu
Lines: 6
Date: 31 Mar 94 14:33:35 GMT
Can anyone tell me where is the header file Movies.h? I seem to recall
reading something about it a while ago, but I can't find it now. Any
help appreciated. Thank you.
Nick.
Path: ucivax!gateway
From: tla@crl.com (Troy Anderson)
Subject: Re: Forcing a window to be on top of all windows
Message-ID: <9403311219.aa08244@q2.ics.uci.edu>
In-Reply-To: <9403290725.aa09740@q2.ics.uci.edu>
Content-Type: TEXT/PLAIN; charset=US-ASCII
Mime-Version: 1.0
Newsgroups: fa.think-c
X-Message-ID: <Pine.3.87.9403311240.A25155-0100000@crl.crl.com>
Approved: usenet@q2.ics.uci.edu
Lines: 14
Date: 31 Mar 94 20:19:03 GMT
I haven't taken this exact approach, but I suspect you could write an
Extension that detects when that application is being launched and patch
NewWindow, ShowWindow, HideWindow, etc. in that application's heap so
that you can massage the window list before the toolbox has its chance to
do its thing. It would be rather involved, but is possible. I wrote
MarkerControl that is an extension that detects when THINK C is launched,
so I know that is possibe. To see what things to patch, just look at the
Think Class Library and see how they implement their floating window
stuff. They do it in the application, but you could probably do the same
thing via patched.
Good luck,
Troy Anderson